开发者

Swing JSplitPane problem

How to Split Component vertically into different parts? I开发者_如何学编程s It possible in Swing? I want to assign different ScrollBar to each part ?


you should use the JSplitPane

if you need each part to be on a diffrent scroller - just put them on to diffrent scroller pane.

JPanel topPanel = new JPanel();
            JScrollPane topScrollPane = new JScrollPane(topPanel);

            JPanel buttomPanel = new JPanel();
            JScrollPane buttomScrollPane = new JScrollPane(buttomPanel);

            JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topScrollPane, buttomScrollPane);


Try using JSplitPane. Then put a JScrollPane into each side.

If you want more than one split, you'd have to nest the split panes. Or use a multi-splitpane like this: MultiSplitPane

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜