1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| public class uu {
private JFrame jFrame = null; // @jve:decl-index=0:visual-constraint="248,-20"
private JMenuBar jJMenuBar = null;
private JMenuItem jMenuItem = null; // @jve:decl-index=0:visual-constraint="96,-7"
/**
* This method initializes jFrame
*
* @return javax.swing.JFrame
*/
private JFrame getJFrame() {
if (jFrame == null) {
jFrame = new JFrame();
jFrame.setSize(441, 188);
jFrame.setTitle("hello");
jFrame.setVisible(true);
jFrame.setJMenuBar(getJJMenuBar());
jFrame.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent e) {
System.out.println("keyPressed()"); // TODO Auto-generated Event stub keyPressed()
}
});
jFrame.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent e) {
if ((e.getPropertyName().equals("enabled"))) {
System.out.println("propertyChange(enabled)"); // TODO Auto-generated property Event stub "enabled"
}
}
});
}
return jFrame;
}
/**
* This method initializes jJMenuBar
*
* @return javax.swing.JMenuBar
*/
private JMenuBar getJJMenuBar() {
if (jJMenuBar == null) {
jJMenuBar = new JMenuBar();
jJMenuBar.setPreferredSize(new java.awt.Dimension(0,20));
//jJMenuBar.setText("Fichier");
jJMenuBar.add(getJMenuItem()) ;
}
return jJMenuBar;
}
/**
* This method initializes jMenuItem
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getJMenuItem() {
if (jMenuItem == null) {
jMenuItem = new JMenuItem();
jMenuItem.setText("Fichier");
}
return jMenuItem;
}
public static void main(String[] args) {
}
} |
Partager