怎么给图中的1,2,3,4 分别加滚动条
2条回答 默认 最新
iteye_5246 2012-12-05 20:12关注[code="java"]public class AppDemo extends JFrame {
public AppDemo() {
getContentPane().setLayout(null);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(12, 46, 418, 217);
getContentPane().add(scrollPane);
//image 代码。。
scrollPane.setViewportView(image);
JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
scrollBar.setValue(600);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(450, 300);
setVisible(true);
}public static void main(String[] args) { new AppDemo(); }}[/code]
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报