Problems with the drag and drop facility while using the GUI interface

Asked By 40 points N/A Posted on -
qa-featured

Hi,

I'm using the GUI interface for Netbeans 7.1, but I'm having problems with the drag and drop facility.

I have made two JPanels (ParentPanel & ChildPanel). I used a simple JLabel on each one to identify them, but when I try to drag and drop the childpanel into the ParentPanel, an error is shown, saying that it is unable to add.

I tried reverting back to an older version of Java and creating a new project. Then, I was able to drag the ChildPanel without any problems onto the ParentPanel.

Please see the screenshots.

Does Java 7 have known compatibility problems with GUI interfaces?

 

 

Information: Cannot load component class test.ChildPanel from project: D:projectsSwingBugExample.

The class must be compiled and must be on the classpath of the project to which this form belongs.

SHARE
Answered By 0 points N/A #152403

Problems with the drag and drop facility while using the GUI interface

qa-featured

Hello,

What I can see from your screenshots that you don't have a main class

in order to have any java project to run you need a main class and it cannot be JPanels because it does not contain the method main (public static void main(String args[])).

Instead you can use JFrame or you should have one JFrame added in your project, after that you need to compile.

Netbeans 7 has dropped a lot of facilities and features specially the "add & drop" options, so I suggest that if you are a beginner to use an earlier version of Netbeans..

Regards..

Related Questions