Putting JPanel on JFrame of any use?

0 down vote favorite

I am working in the NetBeans . For that when I am working in the new JFrame form or the design view if I add the panel and then add the label and rest of the contents, it makes no difference if I don’t add a panel and add the contents like JLabel, JButton, etc. it makes no difference.

Is there any reason why panel should be added to the frame? I tried to close the application when the panel was inserted and when it was not inserted on the frame, the application closes both the times. (When I press run and try to close the application, both times it closes.)

Then what is the use of putting JPanel on a JFrame?

1 Like

I do not think this is the correct place to ask such GUI based questions, seek help in some other forum like stackoverflow or javaranch/coderanch.

You may want to take a look at the discussions here and maybe here.