我正在尝试制作一个小程序。当我执行它时,我插入行和列,然后当我单击按钮时,屏幕上会出现一个矩阵。我的问题是,当行数较大时,我看不到下面的所有矩阵和其他内容,并且我无法在 JFrame 中向下移动。我怎样才能做到这一点?如何添加电梯以便上下移动?我不确定它是否称为电梯( window 右侧帮助我们上下移动的物体)。请帮助我...提前谢谢您。
最佳答案
"how can I add a lift, or elevator, to make possible to move up and down? I am not sure if it is called a lift ( the object at the right of the window that helps us to move up and down)."
将 JTable
包装在 JScrollPane
JTable table = new JTable();
JScrollPane scroll = new JScrollPane(table);
container.add(scroll);
确保从容器中删除表格,因为组件只能有一个父容器
<小时/>关于java - Jframe中上下移动,如何做升降?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21353913/