Package Scope [message #611550] |
Wed, 14 December 2005 23:16 |
Jeff Messages: 21 Registered: July 2009 |
Junior Member |
|
|
I'm having a problem with the visual editor with package scope.
I created a visual class that overrides JPanel called InnerPanel like this:
package testve;
import java.awt.LayoutManager;
import javax.swing.JPanel;
import javax.swing.JButton;
class InnerPanel extends JPanel {
....
}
Which is a package scope class inside of the testve package.
I then created another visual class called MainWindow that overrides JFrame which has a main method that creates itself like this:
package testve;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import java.awt.GraphicsConfiguration;
import java.awt.HeadlessException;
import javax.swing.JFrame;
class MainWindow extends JFrame {
private JPanel jContentPane = null;
private InnerPanel innerPanel = null;
....
public static void main( String [] args ) {
MainWindow w = new MainWindow();
}
}
which is in the same package. When I click on Choose Bean, and select to add InnerPanel to the MainWindow class, the Visual Editor shows an X over the inner panel in the java beans tab, and it does not show up.
However, if I run the program, it works fine, and the InnerPanel was added properly. Why does the visual editor not work with package scope? If I change InnerPanel to public scope, the red X goes away.
Any help is greatly appreciated.
|
|
|
Powered by
FUDForum. Page generated in 0.03033 seconds