P
petoeter
I created a
public class gegevens implements ActionListener {
gegevens() {
some code to create and add textfields,
buttons, ...
button1.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if(e.getSource == button1) {
textfield1 = setText("xx");
}
}
on an other file I have a
class b extends JPanel {
b() {
gegevens geg = new gegevens();
this.add(geg);
}
}
to use in a public class with different panels.
Eclipse seems happy with this, but when hitting the button, it won't
work.
What did I miss?
Thanks,
public class gegevens implements ActionListener {
gegevens() {
some code to create and add textfields,
buttons, ...
button1.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if(e.getSource == button1) {
textfield1 = setText("xx");
}
}
on an other file I have a
class b extends JPanel {
b() {
gegevens geg = new gegevens();
this.add(geg);
}
}
to use in a public class with different panels.
Eclipse seems happy with this, but when hitting the button, it won't
work.
What did I miss?
Thanks,