两个JTable共用滚动条
我有两张桌子。一个表格是固定列(即该表格不会对另一表格的滚动条滚动产生任何影响)。这两个表通常必须通过垂直滚动条滚动。有什么想法、建议或示例吗?
这是上一个问题的延续。 固定列 答案就在这里 FixedColumn.java
I have two tables. One table is a fixed column(ie. the table will not have any impact on the scrolling of scrollbar of another table). These two tables have to be commonly scrolled by a vertical scrollbar.Any idea or suggesstion or examples?
This is a continuation of the previous question.
Fixed Column
The answer for which is here FixedColumn.java
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
固定列表 或 行号表给出了一些想法。
Fixed Column Table or Row Number Table give some ideas.
这个问题有一个简单的解决方案。只需将“固定列”表放入用于第二个表的滚动窗格的“行标题”装饰区域即可。它应该类似于以下内容:
您可以在 找到更多信息http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html#decorations
There is a simple solution to this problem. Just put your "fixed column" table into "row header" decoration area of scroll pane used for the second table. it should something like following:
You can find more information at http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html#decorations