开发者

Java: Multiple JScrollPanes show view on 1 common component

开发者 https://www.devze.com 2023-01-12 04:42 出处:网络
how (if at all) can I make multiple JScrollPanes have different views on 1 common component (a JTable in this case). Every time I set the viewport of a scrollpane, the p开发者_开发百科revious scrollpa

how (if at all) can I make multiple JScrollPanes have different views on 1 common component (a JTable in this case). Every time I set the viewport of a scrollpane, the p开发者_开发百科revious scrollpane's view disappears...

Cheers, Max


A Component can have only 1 parent. You can't put the same JTable in two JScrollPanes. You can, however, create two JTables backed by the same model, and put those two tables into their own scroll panes.

0

精彩评论

暂无评论...
验证码 换一张
取 消