现有一个JFrame,别的地方还有两个设定好大小的jpanel,如何把panel2显示在jpanel1上一层?
this.setLocation(200,200);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
JLayeredPane layout=new JLayeredPane();
this.setLayeredPane(layout);
//外部class有两个大小为200x200的jpanel1和panel2
//如何添加panel2到窗口最上层,panel1到panel2的下一层?
this.pack();
this.setVisible(true);