How can I view the visual components from a class that extends from an abstract class? [message #617576] |
Mon, 14 December 2009 18:40 |
Danilo  Messages: 9 Registered: September 2009 |
Junior Member |
|
|
Hello!
I've created an abstract class that extends from JPanel. If I create any class that extends this first class, that class doesn't show the componentes from the first class.
What can I do for showing the components?
public abstract class AbstractClass extends JPanel {
private JLabel jLabel = null;
public AbstractClass() {
super();
initialize();
}
private void initialize() {
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
jLabel = new JLabel();
jLabel.setText("JLabel");
this.setSize(300, 200);
this.setLayout(new GridBagLayout());
this.add(jLabel, gridBagConstraints);
}
}
public class A extends AbstractClass {
}
|
|
|
Powered by
FUDForum. Page generated in 0.01397 seconds