Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何(如果有的话)使多个 JScrollPanes 对 1 个公共组件(在这种情况下为 JTable)具有不同的视图。每次我设置滚动窗格的视口时,前一个滚动窗格的视图都会消失......
干杯,马克斯
AComponent只能有 1 个父级。你不能把相同的东西JTable放在两个中JScrollPanes。但是,您可以创建两个JTable由同一模型支持的 s,并将这两个表放入它们自己的滚动窗格中。
Component
JTable
JScrollPanes