public class Boot extends JWindow implements KeyListener
{
public Boot()
{
…..
this.addKeyListener(this);
….
}
public void keyTyped(KeyEvent ke)
{
System.out.println( ke.getKeyChar());
}
public void keyPressed(KeyEvent ke)
{
System.out.println( ke.getKeyChar());
/* KEY EVENTS */
// KeyEvent.KEY_TYPED
// KeyEvent.KEY_PRESSED
// int id = id.getId();
}
public void keyReleased(KeyEvent ke)
{
System.out.println( ke.getKeyChar());
}
}
JFrame frame = new JFrame();
frame.setVisible( true );
JWindow window = new JWindow(frame);
JWindow window = new JWindow(new JFrame(“is Showing”)
{
public boolean isShowing()
{
return true;
}
});
Add Comment