WindowListener , :
public void windowOpened(WindowEvent event) .
public voidwindowClosing(WindowEventevent) (, ). , , (, ? , ).
public void windowClosed(WindowEvent event) .
public void windowIconified(WindowEvent event) .
public void windowDeiconified(WindowEvent event) .
public void windowActivated(WindowEvent event) .
public void windowDeactivated(WindowEvent event) .
omponentListener
ComponentListener , , . :
public voidcomponentMoved(ComponentEventevent) , ( setLocation(), - ).
public voidcomponentResized(ComponentEventevent) , .
public voidcomponentHidden(ComponentEventevent) , .
public voidcomponentShown(ComponentEventevent) , .
ItemListener
ItemListener , . , JComboBox , . JCheckBox JRadioButton, JToggleButton .. :
public void itemStateChanged(ItemEvent event).
ActionListener
, ( , ), , , . , , .
ActionListener, :
public void actionPerformed(ActionEvent event).
ActionListener (, - , ). , .
|
|
ok ActionListener:
ok.addMouseListener(new ActionListener() { public void actionPerformed(ActionEvent event) { if (loginField.getText().equals("")) JOptionPane.showMessageDialog(null, ""); elseJOptionPane.showMessageDialog(null, ""); } }); |
1. -, . 0-20 . , , / . , . , .
2. Java, . , :
a. CENTER
( )
b. WEST
( )
c. SOUTH
( )
d. NORTH ( )
e. EAST
( )
3. Java JTextArea :
: : ,
: : TimesNewRoman, MSSansSerif, CourierNew. , , , JTextArea
7