Code:
/**
* 26.07.2008
* Erik Schulz
*/
package meinPaket;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
public class HalloWelt extends JFrame
{
private static final long serialVersionUID = 1L;
public HalloWelt()
{
JTextField text = new JTextField("Hallo Welt");
this.getContentPane().add(text);
}
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
HalloWelt window = new HalloWelt();
window.setTitle("GIZEH 1.0");
// window.setSize(MAXIMIZED_BOTH)
window.setResizable(true);
window.setVisible(true);
window.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
JMenuBar hauptmenu = new JMenuBar();
JMenu fileMenu = new JMenu ("&Datei");
JMenu additionalenu = new JMenu ("&Extras");
JMenu questions = new JMenu ("&?");
hauptmenu.add( fileMenu );
hauptmenu.add( additionalenu);
hauptmenu.add( questions );
HalloWelt.setJMenuBar( hauptmenu );
}
}