解决方案 »

  1.   

    代码没贴完,border怎么设置的
    GUI需要一步一步调整才能看到效果。
      

  2.   


    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setViewportBorder(new TitledBorder(UIManager
    .getBorder("TitledBorder.border"),
    "\u5F85\u6DFB\u52A0\u9879\u76EE\uFF1A", TitledBorder.LEADING,
    TitledBorder.TOP, null, null));
    GridBagConstraints gbc_scrollPane = new GridBagConstraints();
    gbc_scrollPane.gridwidth = 4;
    gbc_scrollPane.insets = new Insets(0, 0, 5, 5);
    gbc_scrollPane.fill = GridBagConstraints.BOTH;
    gbc_scrollPane.gridx = 1;
    gbc_scrollPane.gridy = 1;
    contentPane.add(scrollPane, gbc_scrollPane);这个是border的 设置。。
      

  3.   

     To add a border around the main viewport, you can use setViewportBorder. (Of course, you can also add a border around the whole scroll pane using setBorder.)