Is it possible to a开发者_运维知识库dd a JPanel
to a JFrame
? How can it be done?
JFrame frame = new JFrame();
JPanel panel = new JPanel();
Sure it's possible - you can do it like this:
frame.setContentPane(panel);
This panel will be the container in which you'll put all the components of your UI(except the menubar).
yes, sure, same way as you would add any component to any container:
frame.add(panel)
精彩评论