本文整理汇总了Java中org.jdesktop.swingx.JXMultiSplitPane.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Java JXMultiSplitPane.setLayout方法的具体用法?Java JXMultiSplitPane.setLayout怎么用?Java JXMultiSplitPane.setLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXMultiSplitPane
的用法示例。
在下文中一共展示了JXMultiSplitPane.setLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSplitPane
import org.jdesktop.swingx.JXMultiSplitPane; //导入方法依赖的package包/类
private JComponent createSplitPane() {
final JComponent demoContainer = new JXPanel();
demoContainer.setLayout(new BorderLayout()); //BoxLayout(demoContainer, BoxLayout.LINE_AXIS));
demoContainer.setBorder(BorderFactory.createLineBorder(Color.RED));
// <snip> MultiSplit layout declaration
String layout =
"(ROW " +
"(LEAF name=selector weight=0.3)" +
"(COLUMN weight=0.7 " +
"(LEAF name= demo weight=0.7)" +
"(LEAF name=source weight=0.3)" +
")" +
")";
MultiSplitLayout multiSplitLayout = new MultiSplitLayout(MultiSplitLayout.parseModel(layout));
// </snip>
JXMultiSplitPane splitPane = new JXMultiSplitPane();
splitPane.setLayout(multiSplitLayout);
splitPane.add("selector", createButtonStack(demoContainer));
splitPane.add("demo", demoContainer);
return splitPane;
}
示例2: createMainPanel
import org.jdesktop.swingx.JXMultiSplitPane; //导入方法依赖的package包/类
protected JComponent createMainPanel() {
// <snip> MultiSplit layout declaration
String layout =
"(ROW " +
"(LEAF name=selector weight=0.25)" +
"(COLUMN weight=0.75 " +
"(LEAF name= demo weight=0.7)" +
"(LEAF name=source weight=0.3)" +
")" +
")";
multiSplitLayout = new MultiSplitLayout(MultiSplitLayout.parseModel(layout));
// </snip>
JXMultiSplitPane splitPane = new JXMultiSplitPane();
splitPane.setLayout(multiSplitLayout);
// Create demo selector panel on left
JComponent demoSelectorPanel = demoSelector.getSelectorComponent();
demoSelectorPanel.setBorder(PANEL_BORDER);
splitPane.add(demoSelectorPanel, "selector");
// Create panel to contain currently running demo
JComponent demoContainer = new JXPanel();
demoContainer.setLayout(new BorderLayout());
demoContainer.setBorder(PANEL_BORDER);
splitPane.add(demoContainer, "demo");
// Create source code pane
codeViewer = new CodeViewer();
// Font font = codeViewer.getFont();
// codeViewer.setFont(font.deriveFont(Font.BOLD, 20.f));
JComponent codeContainer = new JPanel(new BorderLayout());
codeContainer.add(codeViewer);
codeContainer.setBorder(PANEL_BORDER);
splitPane.add(codeContainer, "source");
// Create shareable popup menu for demo actions
popup = new JPopupMenu();
popup.add(new EditPropertiesAction());
popup.add(new ViewCodeSnippetAction());
return splitPane;
}