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?