js.doLayout(); JScrollBar jsVB = js.getVerticalScrollBar(); if (jsVB != null) { jsVB.setValue(jsVB.getMaximum() / 2); } JScrollBar jsHB = js.getHorizontalScrollBar(); if (null != jsHB) { jsHB.setValue(jsHB.getMaximum() / 6); }
Swing 设置JScrollPanel 滚动条位置,布布扣,bubuko.com
原文地址:http://blog.csdn.net/daixinmei/article/details/38559437