Panel是放在窗口(Frame)上的一个子界面,它也是做一个页面设计的作用,无法进行交互
1 //布局的定义 2 Panel panel = new Panel(); 3 //panel设置坐标,相较于frame 4 panel.setBounds(50,50,400,400); 5 panel.setBackground(Color.BLUE);