jlabel.setText("<html>sdfsdfdf<br>ouojljl</html>");

解决方案 »

  1.   

    首先border不是component,只是负责在组件上绘制border,
    panel会调用border的paint方法,所以挡住了JCheckBox
    你可以用一个大的panel代替一下JPanel outterPanel = new JPanel (new BorderLayout());
    outterPanel .add(checkBox,BorderLayout.NORTH);
    outterPanel .add(panel,BorderLayout.CENTER);
      

  2.   

    我不是很确定你什么意思,不知道这个行不行public class Frame1 extends JFrame {
      private JPanel jPanel1 = new JPanel();
      private Border border1;
      private JComboBox jComboBox1 = new JComboBox();  public Frame1() {
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      public static void main(String[] args) {
        Frame1 frame1 = new Frame1();
        frame1.show();
      }
      private void jbInit() throws Exception {
        border1 = BorderFactory.createEtchedBorder(new Color(187, 218, 252),new Color(91, 107, 123));
        this.setSize(new Dimension(400,300));
        this.getContentPane().setLayout(null);
        jPanel1.setBorder(border1);
        jPanel1.setBounds(new Rectangle(43, 49, 296, 187));
        jPanel1.setLayout(null);
        jComboBox1.setBounds(new Rectangle(1, 162, 295, 25));
        this.getContentPane().add(jPanel1, null);
        jPanel1.add(jComboBox1, null);
      }
    }
      

  3.   

    对于第二问,你可以用JTextArea代替JLabel,然后把JLabel的属性(背景色、字体)等设置给JTextArea
      

  4.   

    JPanel outterPanel = new JPanel (new BorderLayout());
    outterPanel .add(checkBox,BorderLayout.NORTH);
    outterPanel .add(panel,BorderLayout.CENTER);“遥远”的第一个回答好像解决不了问题,它只能在panel横线的上面画个JCheckbox,并不是说压在线上,谁能不能再出出主意。
    有没有像codeproject和codeguru类似的网站,让我上去看看