user1727668
user1727668

Reputation:

Error adding Panel to JFrame in NetBeans

So I made a JPanel and a JFrame using the Design functions in NetBeans and when I try to drag the panel onto the JFrame, I get the error "The component cannot be instantiated. Please make sure it is a JavaBeans component."

What I did was create an empty Frame and then create the Panel and put it all together using the panels, buttons, and text fields. I didn't modify the source code or anything. Is there some kind of code I need to add into the panel to make it work with the JFrame? Or perhaps I missed a step in the design tab? I've included a picture that shows exactly what it is I made.

jpanel

Upvotes: 2

Views: 1624

Answers (1)

MadProgrammer
MadProgrammer

Reputation: 347332

Clean and build the project (and sub projects as required).

If you're using Netbeans 7+, you can check the messages.log found in C:/Users/{username}/AppData/Roaming/NetBeans/{Netbeans version}/var/log and check for the exception that caused the problem.

I think the new 7.2 beta reports the problems to the user now (thankfully).

Upvotes: 1

Related Questions