本文整理了Java中javax.swing.JSplitPane.setTopComponent()
方法的一些代码示例,展示了JSplitPane.setTopComponent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSplitPane.setTopComponent()
方法的具体详情如下:
包路径:javax.swing.JSplitPane
类名称:JSplitPane
方法名:setTopComponent
暂无
代码示例来源:origin: 4thline/cling
@PostConstruct
public void init() {
browserPanel.add(browserView.asUIComponent(), BorderLayout.CENTER);
browserPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 5));
browserPanel.setPreferredSize(new Dimension(250, 250));
browserPanel.setMinimumSize(new Dimension(250, 250));
infoPanel.add(deviceInfosView.asUIComponent(), BorderLayout.CENTER);
infoPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
infoPanel.setPreferredSize(new Dimension(675, 200));
infoPanel.setMinimumSize(new Dimension(650, 200));
eastWestSplitPane.setBorder(BorderFactory.createEmptyBorder());
eastWestSplitPane.setResizeWeight(0);
eastWestSplitPane.setLeftComponent(browserPanel);
eastWestSplitPane.setRightComponent(infoPanel);
northSouthSplitPane.setBorder(BorderFactory.createEmptyBorder());
northSouthSplitPane.setResizeWeight(0.8);
northSouthSplitPane.setTopComponent(eastWestSplitPane);
northSouthSplitPane.setBottomComponent(logView.asUIComponent());
add(toolbarView.asUIComponent(), BorderLayout.NORTH);
add(northSouthSplitPane, BorderLayout.CENTER);
setSize(new Dimension(975, 700));
setMinimumSize(new Dimension(975, 450));
setResizable(true);
}
代码示例来源:origin: wiztools/rest-client
jsp.setTopComponent(new JScrollPane(jta_in));
jsp.setBottomComponent(jp_south);
代码示例来源:origin: kiegroup/optaplanner
JScrollPane tableScrollPane = new JScrollPane(table);
tableScrollPane.setPreferredSize(new Dimension(700, 300));
splitPane.setTopComponent(tableScrollPane);
JPanel bottomPanel = new JPanel(new BorderLayout());
JLabel detailLabel = new JLabel("Constraint matches of selected constraint type");
代码示例来源:origin: igniterealtime/Smack
table.getSelectionModel().addListSelectionListener(selectionListener);
table.getColumnModel().getSelectionModel().addListSelectionListener(selectionListener);
allPane.setTopComponent(new JScrollPane(table));
messageTextArea = new JTextArea();
messageTextArea.setEditable(false);
代码示例来源:origin: 4thline/cling
splitPane.setTopComponent(inputArgumentsScrollPane);
splitPane.setBottomComponent(outputArgumentsScrollPane);
splitPane.setResizeWeight(0.5);
代码示例来源:origin: knowm/XChart
/** Constructor */
public XChartDemo() {
super(new GridLayout(1, 0));
// Create the nodes.
DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts");
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);
// Create Chart Panel
chartPanel = new XChartPanel(new AreaChart01().getChart());
// Add the scroll panes to a split pane.
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setTopComponent(treeView);
splitPane.setBottomComponent(chartPanel);
Dimension minimumSize = new Dimension(130, 160);
treeView.setMinimumSize(minimumSize);
splitPane.setPreferredSize(new Dimension(700, 700));
// Add the split pane to this panel.
add(splitPane);
}
代码示例来源:origin: stackoverflow.com
splitPane.setTopComponent(topPanel); // at the top we want our "topPanel"
代码示例来源:origin: knowm/XChart
protected void init() {
// Create the nodes.
DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts");
createNodes(top);
tree = new JTree(top);
// Create a tree that allows one selection at a time.
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);
// Create Chart Panel
tabbedPane = new JTabbedPane();
for (int i = 0; i < tree.getRowCount(); i++) {
tree.expandRow(i);
}
// select first leaf
DefaultMutableTreeNode firstLeaf = top.getFirstLeaf();
tree.setSelectionPath(new TreePath(firstLeaf.getPath()));
// Add the scroll panes to a split pane.
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setTopComponent(treeView);
splitPane.setBottomComponent(tabbedPane);
Dimension minimumSize = new Dimension(130, 160);
treeView.setMinimumSize(minimumSize);
splitPane.setPreferredSize(new Dimension(700, 700));
// Add the split pane to this panel.
add(splitPane);
}
代码示例来源:origin: nodebox/nodebox
public void close() {
Container parent = getParent();
if (!(parent instanceof JSplitPane)) return;
JSplitPane split = (JSplitPane) parent;
Component firstComponent = split.getTopComponent();
Component secondComponent = split.getBottomComponent();
Component remainingComponent = firstComponent == this ? secondComponent : firstComponent;
split.setTopComponent(null);
split.setBottomComponent(null);
Container grandParent = parent.getParent();
if (grandParent instanceof JSplitPane) {
JSplitPane grandSplit = (JSplitPane) grandParent;
// Remove the split pane.
if (split == grandSplit.getTopComponent()) {
grandSplit.setTopComponent(remainingComponent);
} else {
grandSplit.setBottomComponent(remainingComponent);
}
} else {
grandParent.remove(parent);
grandParent.add(remainingComponent);
}
grandParent.validate();
}
代码示例来源:origin: nodebox/nodebox
boolean first = parentSplit.getTopComponent() == this;
if (first) {
parentSplit.setTopComponent(newPane);
} else {
parentSplit.setBottomComponent(newPane);
代码示例来源:origin: magefree/mage
jSplitPane1.setTopComponent(cardSelector);
jSplitPane1.setBottomComponent(deckArea);
代码示例来源:origin: magefree/mage
jScrollPane1.setViewportView(tablePlayers);
jSplitPane1.setTopComponent(jScrollPane1);
代码示例来源:origin: nodebox/nodebox
private void split(int orientation) {
Container parent = getParent();
if (parent instanceof JSplitPane) {
JSplitPane parentSplit = (JSplitPane) parent;
boolean first = parentSplit.getTopComponent() == this;
if (first) {
parentSplit.setTopComponent(null);
} else {
parentSplit.setBottomComponent(null);
}
CustomSplitPane split = new CustomSplitPane(orientation, this, this.duplicate());
if (first) {
parentSplit.setTopComponent(split);
} else {
parentSplit.setBottomComponent(split);
}
parentSplit.validate();
} else {
parent.remove(this);
CustomSplitPane split = new CustomSplitPane(orientation, this, this.duplicate());
parent.add(split);
parent.validate();
}
}
代码示例来源:origin: pentaho/mondrian
jSplitPane1.setTopComponent(jScrollPane1);
代码示例来源:origin: magefree/mage
jTablePlayers.getAccessibleContext().setAccessibleDescription("");
jSplitPane1.setTopComponent(jScrollPanePlayers);
代码示例来源:origin: protegeproject/protege
private void processComponentRemoved() {
if (getComponentCount() == ZERO_CONTENT_COUNT) {
if (locationInParent.equals(JSplitPane.LEFT) || locationInParent.equals(JSplitPane.TOP)) {
parentComponent.setTopComponent(null);
}
else {
parentComponent.setBottomComponent(null);
}
}
}
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
private void processComponentRemoved() {
if (getComponentCount() == ZERO_CONTENT_COUNT) {
if (locationInParent.equals(JSplitPane.LEFT) || locationInParent.equals(JSplitPane.TOP)) {
parentComponent.setTopComponent(null);
}
else {
parentComponent.setBottomComponent(null);
}
}
}
}
代码示例来源:origin: edu.utah.bmi.nlp/nlp-core
private void createVerticalSplitPane() {
this.verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
this.verticalSplitPane.setResizeWeight(0.8);
this.verticalSplitPane.setPreferredSize(new Dimension(620, 600));
this.verticalSplitPane.setMinimumSize(new Dimension(200, 200));
// add JTextPane to top of vertical split pane
this.createTextScrollPane();
this.verticalSplitPane.setTopComponent(this.textScrollPane);
// bottom pane is the legend, with checkboxes
this.verticalSplitPane.setBottomComponent(this.createTabbedChoicePane());
}
代码示例来源:origin: protegeproject/protege
public void splitHorizontally(View rightView) {
rightView.setSyncronizing(false);
JSplitPane sp = createSplitPane(JSplitPane.VERTICAL_SPLIT);
View view = (View) getComponent(0);
remove(view);
add(sp);
validate();
sp.setTopComponent(new ViewContainer(view));
sp.setBottomComponent(new ViewContainer(rightView));
sp.setDividerLocation(sp.getHeight() / 2);
}
代码示例来源:origin: org.protege/protege-editor-core-application
public void splitHorizontally(View rightView) {
rightView.setSyncronizing(false);
JSplitPane sp = createSplitPane(JSplitPane.VERTICAL_SPLIT);
View view = (View) getComponent(0);
remove(view);
add(sp);
validate();
sp.setTopComponent(new ViewContainer(view));
sp.setBottomComponent(new ViewContainer(rightView));
sp.setDividerLocation(sp.getHeight() / 2);
}
内容来源于网络,如有侵权,请联系作者删除!