Wie füge ich einer Schaltfläche eine Aktion hinzu?
Ich versuche, ein Ereignis für @ einzugebeJButon
Ich erschaffe
JButton botton1=new JButton("welcom to my show db! lets start");
botton1.setFont(new Font ("Eras Medium ITC",Font.BOLD,20));
this.add(botton1);
JPanel Basic_panel=new JPanel();
Basic_panel.setName("SHOW DB ");
Basic_panel.setBounds(x,y,width,hight);
botton1.addActionListener(this) ;
}
public void actionPerformed(ActionEvent e) {
if (e.getSource()==botton1){
Nun möchte ich noch ein @ eingebJFrame
Ich habe gemacht, und die ersten verschwinden lassen. Wie