mardi 5 mai 2015
Swing Basics - JButton funktioniert nicht.
Posted on 10:54 by verona
Hi, hat jemand eine Idee, wieso mein Button nicht funktioniert? Der button soll das layout vom anderen Fenster ändern!
Java Code:
-
import java.awt.*;
-
import java.awt.event.ActionEvent;
-
import java.awt.event.ActionListener;
-
-
import javax.swing.*;
-
-
-
public static int anzahl = 0;
-
-
super(s);
-
anzahl++;
-
-
-
setSize(i,j);
-
setLocation(80*anzahl,80*anzahl);
-
setVisible(true);
-
setDefaultCloseOperation(EXIT_ON_CLOSE);
-
-
}
-
-
-
-
-
MyFrame frame2 = new MyFrame("Fenster2",400,400);
-
-
-
frame2.add(label0);
-
frame2.add(label1);
-
frame2.add(label2);
-
frame2.add(label3);
-
frame2.add(label4);
-
-
new MyDialog(frame2,"Buttons");
-
-
-
}
-
}
-
-
MyFrame frame;
-
-
ButtonListener(MyFrame frame) {
-
this.frame = frame;
-
}
-
-
if (e.getActionCommand().equals("Previous")){
-
}
-
if (e.getActionCommand().equals("Next")){
-
}
-
-
-
-
}
-
-
}
-
-
-
-
-
MyFrame frame;
-
-
-
add(button1);
-
add(button2);
-
setSize(200,100);
-
setTitle(s);
-
setVisible(true);
-
-
frame = f;
-
-
button1.addActionListener(al);
-
button1.setActionCommand("Previous");
-
button2.addActionListener(al);
-
button2.setActionCommand("Next");
-
}
-
-
}
Swing Basics - JButton funktioniert nicht.
Categories: Swing Basics - JButton funktioniert nicht.
Inscription à :
Publier les commentaires (Atom)
0 commentaires:
Enregistrer un commentaire