//从上到下设置标签和滚动板. JPanel listPane = new JPanel(); listPane.setLayout (new BoxLayout (listPanae, BoxLayout, Y_AXIS) ); JLabel label = new JLabel (labelText); listPane.add (label); listPane.add (Box.createRigidArea (new Demension (0, 5) ) ); listPane.add (listScroller); listPane.setBorder (BorderFactory.creatEmptyBorder (10, 10, 10, 10);