public class JFrame extends JComponent {
JButton button=new JButton("迈皋桥");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new AnotherFrame1();
new Bclass();Bclass.ID="迈皋桥";
}
});
this.add(button);class AnotherFrame extends JFrame implements ActionListener{
public AnotherFrame1() {
JButton hitotu;
JButton futatu;
JButton close = new JButton("cancel");
final JTextField gamen=new JTextField(Bclass.ID);
{
。
}为何在Frame中激活AnotherFrame之后AnotherFrame中JTextfield不初始化显示BClass.ID呢
new Bclass();Bclass.ID="迈皋桥";
这两句你是不是应该反过来?
像这样……
new Bclass();Bclass.ID="迈皋桥";
new AnotherFrame1();