本文整理汇总了Java中javax.swing.JSplitPane.setTopComponent方法的典型用法代码示例。如果您正苦于以下问题:Java JSplitPane.setTopComponent方法的具体用法?Java JSplitPane.setTopComponent怎么用?Java JSplitPane.setTopComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JSplitPane
的用法示例。
在下文中一共展示了JSplitPane.setTopComponent方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildDisplay
import javax.swing.JSplitPane; //导入方法依赖的package包/类
@Override
protected void buildDisplay() {
JPanel queryPane = new JPanel(new BorderLayout());
JLabel leading = new JLabel(" ?- ");
leading.setFont(leading.getFont().deriveFont(Font.BOLD));
queryPane.add(leading, BorderLayout.WEST);
queryPane.add(getQueryField(), BorderLayout.CENTER);
JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
buttonsPane.add(createExecuteButton());
buttonsPane.add(getNextResultButton());
buttonsPane.setBorder(null);
queryPane.add(buttonsPane, BorderLayout.EAST);
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setOneTouchExpandable(true);
splitPane.setDividerLocation(.4);
splitPane.setBottomComponent(getTabPane());
splitPane.setTopComponent(getResultsPanel());
JPanel mainPane = new JPanel(new BorderLayout());
mainPane.add(queryPane, BorderLayout.NORTH);
mainPane.add(splitPane, BorderLayout.CENTER);
setLayout(new BorderLayout());
add(mainPane, BorderLayout.CENTER);
}
示例2: getDisplayPanel
import javax.swing.JSplitPane; //导入方法依赖的package包/类
/** Lazily creates and returns the top-level display panel. */
private JSplitPane getDisplayPanel() {
JSplitPane result = this.displayPanel;
if (result == null) {
this.displayPanel = result = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
result.setTopComponent(getGraphPanel());
result.setBottomComponent(getErrorPanel());
result.setDividerSize(0);
result.setContinuousLayout(true);
result.setResizeWeight(0.9);
result.resetToPreferredSizes();
result.setBorder(null);
}
return result;
}
示例3: DiffResultsView
import javax.swing.JSplitPane; //导入方法依赖的package包/类
public DiffResultsView (SearchHistoryPanel parent, List<RepositoryRevision> results) {
this.parent = parent;
this.results = results;
treeView = new DiffTreeTable(parent);
treeView.setResults(results);
treeView.addAncestorListener(this);
diffView = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
diffView.setTopComponent(treeView);
setBottomComponent(new NoContentPanel(NbBundle.getMessage(DiffResultsView.class, "MSG_DiffPanel_NoRevisions"))); // NOI18N
list = WeakListeners.propertyChange(this, null);
}
示例4: buildInfoPanel
import javax.swing.JSplitPane; //导入方法依赖的package包/类
/** Adjust the info panel by retrieving upper and lower info subpanels from the selected tab. */
protected void buildInfoPanel() {
JComponent upperInfoPanel = null;
JComponent lowerInfoPanel = null;
ResourceTab tab = getSelectedTab();
if (tab != null) {
upperInfoPanel = tab.getUpperInfoPanel();
lowerInfoPanel = tab.getLowerInfoPanel();
}
JPanel infoPanel = (JPanel) getInfoPanel();
String key;
if (lowerInfoPanel == null || !lowerInfoPanel.isEnabled()) {
// if we switch from split to single, freeze the divider location
if (upperInfoPanel != null && upperInfoPanel.getParent() == getSplitInfoPanel()) {
this.frozenDividerPos = getSplitInfoPanel().getDividerLocation();
}
getSingleInfoPanel().removeAll();
if (upperInfoPanel != null) {
getSingleInfoPanel().add(upperInfoPanel, BorderLayout.CENTER);
getSingleInfoPanel().validate();
getSingleInfoPanel().repaint();
}
key = this.SINGLE_INFO_KEY;
} else {
JSplitPane splitInfoPanel = getSplitInfoPanel();
int dividerPos = this.frozenDividerPos;
this.frozenDividerPos = 0;
if (dividerPos == 0) {
dividerPos = splitInfoPanel.getDividerLocation();
}
splitInfoPanel.setTopComponent(upperInfoPanel);
splitInfoPanel.setBottomComponent(lowerInfoPanel);
splitInfoPanel.setDividerLocation(dividerPos);
key = this.SPLIT_INFO_KEY;
}
((CardLayout) infoPanel.getLayout()).show(infoPanel, key);
}
示例5: init
import javax.swing.JSplitPane; //导入方法依赖的package包/类
private void init() {
setLayout(new BorderLayout());
projectNReusableTreeSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
projectNReusableTreeSplitPane.setOneTouchExpandable(true);
projectNReusableTreeSplitPane.setResizeWeight(0.5);
projectNReusableTreeSplitPane.setTopComponent(getTreeInPanel("Test Plan", testDesign.getProjectTree().getTree()));
appReusablePanel = getRTreeInPanel("Reusable Component", testDesign.getReusableTree().getTree());
projectNReusableTreeSplitPane.setBottomComponent(appReusablePanel);
testCaseNTestDataSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
testCaseNTestDataSplitPane.setOneTouchExpandable(true);
testCaseNTestDataSplitPane.setResizeWeight(0.5);
testCaseNTestDataSplitPane.setTopComponent(testDesign.getTestCaseComponent());
testCaseNTestDataSplitPane.setBottomComponent(testDesign.getTestDatacomp());
oneTwo = new JSplitPane();
oneTwo.setOneTouchExpandable(true);
oneTwo.setResizeWeight(0.25);
oneTwo.setLeftComponent(projectNReusableTreeSplitPane);
oneTwo.setRightComponent(testCaseNTestDataSplitPane);
oneThree = new JSplitPane();
oneThree.setOneTouchExpandable(true);
oneThree.setResizeWeight(0.8);
oneThree.setLeftComponent(oneTwo);
oneThree.setRightComponent(testDesign.getObjectRepo());
add(oneThree);
}
示例6: init
import javax.swing.JSplitPane; //导入方法依赖的package包/类
private void init() {
setLayout(new BorderLayout());
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setOneTouchExpandable(true);
splitPane.setBottomComponent(objectTable);
TreeSearch tSearch = TreeSearch.installForOR(objectTree.getTree());
splitPane.setTopComponent(tSearch);
splitPane.setResizeWeight(.5);
splitPane.setDividerLocation(.5);
add(splitPane);
}
示例7: TreeDemo
import javax.swing.JSplitPane; //导入方法依赖的package包/类
public TreeDemo() {
super(new GridLayout(1, 0));
// Create the nodes.
DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
createNodes(top);
// Create a tree that allows one selection at a time.
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
// Listen for when the selection changes.
tree.addTreeSelectionListener(this);
if (playWithLineStyle) {
System.out.println("line style = " + lineStyle);
tree.putClientProperty("JTree.lineStyle", lineStyle);
}
// Create the scroll pane and add the tree to it.
JScrollPane treeView = new JScrollPane(tree);
// Create the HTML viewing pane.
htmlPane = new JEditorPane();
htmlPane.setEditable(false);
initHelp();
JScrollPane htmlView = new JScrollPane(htmlPane);
// Add the scroll panes to a split pane.
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setTopComponent(treeView);
splitPane.setBottomComponent(htmlView);
Dimension minimumSize = new Dimension(100, 50);
htmlView.setMinimumSize(minimumSize);
treeView.setMinimumSize(minimumSize);
splitPane.setDividerLocation(100);
splitPane.setPreferredSize(new Dimension(500, 300));
// Add the split pane to this panel.
add(splitPane);
}
示例8: TreeIconDemo
import javax.swing.JSplitPane; //导入方法依赖的package包/类
public TreeIconDemo() {
super(new GridLayout(1, 0));
// Create the nodes.
DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
createNodes(top);
// Create a tree that allows one selection at a time.
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
// Set the icon for leaf nodes.
ImageIcon leafIcon = createImageIcon("images/middle.gif");
if (leafIcon != null) {
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
renderer.setLeafIcon(leafIcon);
tree.setCellRenderer(renderer);
} else {
System.err.println("Leaf icon missing; using default.");
}
// Listen for when the selection changes.
tree.addTreeSelectionListener(this);
// Create the scroll pane and add the tree to it.
JScrollPane treeView = new JScrollPane(tree);
// Create the HTML viewing pane.
htmlPane = new JEditorPane();
htmlPane.setEditable(false);
initHelp();
JScrollPane htmlView = new JScrollPane(htmlPane);
// Add the scroll panes to a split pane.
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setTopComponent(treeView);
splitPane.setBottomComponent(htmlView);
Dimension minimumSize = new Dimension(100, 50);
htmlView.setMinimumSize(minimumSize);
treeView.setMinimumSize(minimumSize);
splitPane.setDividerLocation(100); // XXX: ignored in some releases
// of Swing. bug 4101306
// workaround for bug 4101306:
// treeView.setPreferredSize(new Dimension(100, 100));
splitPane.setPreferredSize(new Dimension(500, 300));
// Add the split pane to this panel.
add(splitPane);
}
示例9: TreeIconDemo2
import javax.swing.JSplitPane; //导入方法依赖的package包/类
public TreeIconDemo2() {
super(new GridLayout(1, 0));
// Create the nodes.
DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series");
createNodes(top);
// Create a tree that allows one selection at a time.
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
// Enable tool tips.
ToolTipManager.sharedInstance().registerComponent(tree);
// Set the icon for leaf nodes.
ImageIcon tutorialIcon = createImageIcon("images/middle.gif");
if (tutorialIcon != null) {
tree.setCellRenderer(new MyRenderer(tutorialIcon));
} else {
System.err.println("Tutorial icon missing; using default.");
}
// Listen for when the selection changes.
tree.addTreeSelectionListener(this);
// Create the scroll pane and add the tree to it.
JScrollPane treeView = new JScrollPane(tree);
// Create the HTML viewing pane.
htmlPane = new JEditorPane();
htmlPane.setEditable(false);
initHelp();
JScrollPane htmlView = new JScrollPane(htmlPane);
// Add the scroll panes to a split pane.
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setTopComponent(treeView);
splitPane.setBottomComponent(htmlView);
Dimension minimumSize = new Dimension(100, 50);
htmlView.setMinimumSize(minimumSize);
treeView.setMinimumSize(minimumSize);
splitPane.setDividerLocation(100); // XXX: ignored in some releases
// of Swing. bug 4101306
// workaround for bug 4101306:
// treeView.setPreferredSize(new Dimension(100, 100));
splitPane.setPreferredSize(new Dimension(500, 300));
// Add the split pane to this panel.
add(splitPane);
}
示例10: SmileDemo
import javax.swing.JSplitPane; //导入方法依赖的package包/类
public SmileDemo() {
super(new GridLayout(1,0));
//Create the nodes.
DefaultMutableTreeNode top = new DefaultMutableTreeNode("Smile");
createNodes(top);
//Create a tree that allows one selection at a time.
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
//Listen for when the selection changes.
tree.addTreeSelectionListener(this);
//Create the scroll pane and add the tree to it.
JScrollPane treeView = new JScrollPane(tree);
JPanel placeholder = new JPanel(new BorderLayout());
placeholder.setBackground(Color.white);
//Create the log pane.
logPane = new JTextArea();
logPane.setEditable(false);
JScrollPane logView = new JScrollPane(logPane);
redirectSystemStreams();
workspace = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
workspace.setTopComponent(placeholder);
workspace.setBottomComponent(logView);
workspace.setDividerLocation(700);
//Add the scroll panes to a split pane.
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
splitPane.setLeftComponent(treeView);
splitPane.setRightComponent(workspace);
Dimension minimumSize = new Dimension(100, 50);
placeholder.setMinimumSize(minimumSize);
logView.setMinimumSize(minimumSize);
workspace.setMinimumSize(minimumSize);
treeView.setMinimumSize(minimumSize);
splitPane.setDividerLocation(300);
splitPane.setPreferredSize(new Dimension(1000, 800));
//Add the split pane to this panel.
add(splitPane);
}
示例11: TreeDemo
import javax.swing.JSplitPane; //导入方法依赖的package包/类
public TreeDemo() {
super(new GridLayout(1,0));
//Create the nodes.
DefaultMutableTreeNode top =
new DefaultMutableTreeNode("The Java Series");
createNodes(top);
//Create a tree that allows one selection at a time.
tree = new JTree(top);
tree.getSelectionModel().setSelectionMode
(TreeSelectionModel.SINGLE_TREE_SELECTION);
//Listen for when the selection changes.
tree.addTreeSelectionListener(this);
if (playWithLineStyle) {
System.out.println("line style = " + lineStyle);
tree.putClientProperty("JTree.lineStyle", lineStyle);
}
//Create the scroll pane and add the tree to it.
JScrollPane treeView = new JScrollPane(tree);
//Create the HTML viewing pane.
htmlPane = new JEditorPane();
htmlPane.setEditable(false);
initHelp();
JScrollPane htmlView = new JScrollPane(htmlPane);
//Add the scroll panes to a split pane.
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setTopComponent(treeView);
splitPane.setBottomComponent(htmlView);
Dimension minimumSize = new Dimension(100, 50);
htmlView.setMinimumSize(minimumSize);
treeView.setMinimumSize(minimumSize);
splitPane.setDividerLocation(100);
splitPane.setPreferredSize(new Dimension(500, 300));
//Add the split pane to this panel.
add(splitPane);
}
示例12: init
import javax.swing.JSplitPane; //导入方法依赖的package包/类
private void init() {
setLayout(new BorderLayout());
testSetCompNtestPlan = new JSplitPane();
testSetCompNtestPlan.setOneTouchExpandable(true);
treeSNTableSplitPane = new JSplitPane();
treeSNTableSplitPane.setOneTouchExpandable(true);
testSettreeNSettingsSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
testSettreeNSettingsSplitPane.setOneTouchExpandable(true);
testplanTreeNSettingsSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
testplanTreeNSettingsSplitPane.setOneTouchExpandable(true);
executionAndConsoleSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
executionAndConsoleSplitPane.setOneTouchExpandable(true);
testSettreeNSettingsSplitPane.setTopComponent(
getCompInPanel(
"TestLab",
TreeSearch.installFor(testExecution.getTestSetTree().getTree())));
testSettreeNSettingsSplitPane.setBottomComponent(
getCompInPanel(
"QuickSettings",
new JScrollPane(
testExecution.getTestSetComp()
.getQuickSettings().getUILeft(this))));
testSettreeNSettingsSplitPane.setDividerLocation(0.5);
treeSNTableSplitPane.setResizeWeight(0.25);
treeSNTableSplitPane.setLeftComponent(testSettreeNSettingsSplitPane);
executionAndConsoleSplitPane.setTopComponent(testExecution.getTestSetComp());
executionAndConsoleSplitPane.setOneTouchExpandable(true);
consolePanel = new ConsolePanel();
treeSNTableSplitPane.setRightComponent(executionAndConsoleSplitPane);
testSetCompNtestPlan.setLeftComponent(treeSNTableSplitPane);
testPullPanel = new TestPlanPullPanel();
testplanTreeNSettingsSplitPane.setTopComponent(testPullPanel);
testplanTreeNSettingsSplitPane.setBottomComponent(
getCompInPanel(
"QuickSettings",
new JScrollPane(
testExecution.getTestSetComp()
.getQuickSettings().getUIRight(this))));
testSetCompNtestPlan.setRightComponent(testplanTreeNSettingsSplitPane);
testSetCompNtestPlan.setResizeWeight(0.8);
add(testSetCompNtestPlan, BorderLayout.CENTER);
}