numberJPanel = new JPanel(); numberJPanel.setBounds( 10, 160, 160 /* 宽度 这里自己算下大小*/, 110 ); numberJPanel.setBorder( new LineBorder( Color.BLACK ) ); numberJPanel.setLayout( new GridLayout( 4, 3) ); // 4行3列//源代码片段来自云代码http://yuncode.net