Hallo Leute ich bin gerade dabei eine Formelsammlung zu erstellen.
Ich habe das Menu schon erstellt nur, wenn ich auf den ersten Knopf drücke und ein neues Frame öffne werden die Buttons dem Frame nicht hinzugefügt.
Codeausschnitt:
Ich habe das Menu schon erstellt nur, wenn ich auf den ersten Knopf drücke und ein neues Frame öffne werden die Buttons dem Frame nicht hinzugefügt.
Codeausschnitt:
Java:
ant[0]= new JButton("Mathe");
ant[0].setBounds(52, 90, 120, 40);
ant[0].addActionListener(new ActionListener(){
public void actionPerformed (final ActionEvent e){
panel.dispose();
mathe = new JFrame ("Mathe");
mathe.setSize(600, 400);
mathe.setLayout(null);
mathe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
amathe = new JLabel ("Bitte Formel aussuchen");
amathe.setBounds(200, 50, 150, 25);
mathe.add(amathe);
mathe.setVisible(true);
aus = new JButton[4];
aus[0].setText("Mitternachtsformel");
aus[1].setText("Binärsystem umrechnen");
aus[2].setText("Binärsystem übersetzen");
aus[3].setText("Immernoch Unnötig!!");
aus[0].setBounds(52, 90, 120, 40);
aus[1].setBounds(52, 160, 120, 40);
aus[2].setBounds(220, 90, 120, 40);
aus[3].setBounds(220, 160, 120, 40);
mathe.add(aus[0]);
mathe.add(aus[1]);
mathe.add(aus[2]);
mathe.add(aus[3]);
}
});