我想在JFrame中添加两个JPanel,我尝试了这个:
JPanel container;
JPanel jp;
JPanel jp2;
FlowLayout layout = new FlowLayout(FlowLayout.CENTER);
container.setLayout(layout);
jp = new Drawing();
jp2= new Drawing2();
container.add(jp);
container.add(jp2);
setContentPane(container)
setVisible(true);
container.setLayout给了我
你能帮帮我吗?谢谢你。显示java.lang.NullPointerException