Skip to main content



      Home
Home » Archived » Visual Editor (VE) » extending an extended JFrame
extending an extended JFrame [message #610339] Fri, 19 August 2005 13:55
Eclipse UserFriend
Originally posted by: codedragon.runbox.com

I am trying to extend a class that is an extension of JFrame. The VE seems
to insist that FooFrameExtended defines its own content pane. I am trying
to define a code Frame class that extends JFrame that my future programs
will use. What am I doing wrong?

Damon Jacobsen
example using Eclipse 3.1.0 and Visual Editor 1.1.0 :

public class FooFrame extends JFrame {
private JPanel jContentPanel = null;

public FooFrame() {
initialize();
}

private void initialize() {
this.setSize(new java.awt.Dimension(300, 200));
this.setContentPane(getJContentPanel());
}

private JPanel getJContentPanel() {
if (jContentPanel == null) {
jContentPanel = new JPanel();
}
return jContentPanel;
}
}
public class FooFrameExtended extends FooFrame {
private JPanel jPanel = null;
FooFrameExtended()
{
super();
initialize();
}
private void initialize()
{
this.getContentPane().add(getJPanel());

}
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel() {
if (jPanel == null) {
jPanel = new JPanel();
}
return jPanel;
}

}
Previous Topic:VE custom components
Next Topic:extending an extended JFrame
Goto Forum:
  


Current Time: Sat Jun 14 19:54:20 EDT 2025

Powered by FUDForum. Page generated in 0.03997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top