看你用什么layout了,如果想精确设置大小的话,要用borland的xylayout

解决方案 »

  1.   

    extends JScrollPane and override getPreferredSize,getMaximumSize, getMinimumSize, then it should works as you expectation.
      

  2.   

    masterz(),Are there other ways can do the same thing as your words.
    I do not want to add my self-define classes.
      

  3.   

    你可以继承JScrollPane 并覆盖他实现大小的几个方法
      

  4.   

    JScrollPane jScrollPane1 = new JScrollPane();
    jScrollPane1.setBounds(new Rectangle(76, 35, 257, 193));
    那就这样吧