本文整理匯總了Java中javax.swing.JSplitPane.setOrientation方法的典型用法代碼示例。如果您正苦於以下問題:Java JSplitPane.setOrientation方法的具體用法?Java JSplitPane.setOrientation怎麽用?Java JSplitPane.setOrientation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JSplitPane
的用法示例。
在下文中一共展示了JSplitPane.setOrientation方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createSplitPane
import javax.swing.JSplitPane; //導入方法依賴的package包/類
private JSplitPane createSplitPane(Component lower) {
JSplitPane pane = new JSplitPane();
if (firstSplit == null) {
firstSplit = Boolean.TRUE;
} else {
firstSplit = Boolean.FALSE;
}
pane.setRightComponent(lower);
pane.setOrientation(JSplitPane.VERTICAL_SPLIT);
pane.setContinuousLayout(true);
pane.setResizeWeight(1);
pane.setDividerLocation(0.80f);
pane.setBorder(BorderFactory.createEmptyBorder());
//Do not install our custom split pane UI on Nimbus L&F
if (!"Nimbus".equals(UIManager.getLookAndFeel().getID())) {
pane.setUI(PropUtils.createSplitPaneUI());
}
// #52188: default F6 behaviour doesn't make to much sense in NB
// property sheet and blocks NetBeans default F6
pane.getActionMap().getParent().remove("toggleFocus");
if( PropUtils.isAqua ) {
pane.setBackground( UIManager.getColor("NbExplorerView.background") ); //NOI18N
}
return pane;
}
示例2: setOrientation
import javax.swing.JSplitPane; //導入方法依賴的package包/類
/**
* Sets the layout orientation of the contained result pane.
*
* @param orientation the orientation (see {@link JSplitPane#VERTICAL_SPLIT}
* and {@link JSplitPane#HORIZONTAL_SPLIT}) to set.
*/
public void setOrientation(int orientation) {
for(JSplitPane view: viewMap.values()){
if (view.getOrientation() != orientation) {
view.setOrientation(orientation);
}
}
}
示例3: setupGui
import javax.swing.JSplitPane; //導入方法依賴的package包/類
private void setupGui(ClientService clientService, PluginService pluginService)
{
model = new SecurityTreeModel(clientService, pluginService);
tree = new JTree(model);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setCellRenderer(new MyTreeCellRenderer());
tree.addTreeSelectionListener(this);
tabManager = new TabManager(clientService, allowEditing);
JScrollPane scroller = new JScrollPane(tree);
scroller.setMinimumSize(new Dimension(200, Integer.MAX_VALUE));
JSplitPane split = AppletGuiUtils.createSplitPane();
split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
split.setContinuousLayout(true);
split.add(scroller, JSplitPane.LEFT);
split.add(tabManager, JSplitPane.RIGHT);
JButton closeButton = new JButton(closeAction);
final int[] rows = {TableLayout.FILL, closeButton.getPreferredSize().height,};
final int[] cols = {TableLayout.FILL, closeButton.getPreferredSize().width,};
content = new JPanel(new TableLayout(rows, cols));
content.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
content.add(split, new Rectangle(0, 0, 2, 1));
content.add(closeButton, new Rectangle(1, 1, 1, 1));
updateEditor();
}
示例4: initialize
import javax.swing.JSplitPane; //導入方法依賴的package包/類
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
setLayout(new BorderLayout());
this.setSize(new Dimension(441, 231));
JSplitPane splitPane = new JSplitPane();
this.add(splitPane, java.awt.BorderLayout.CENTER);
splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitPane.setDividerLocation(0.75d);
splitPane.setLeftComponent(getSelectRowPane());
splitPane.setRightComponent(getJPanel4());
}
示例5: erzeugeAuflisterPanel
import javax.swing.JSplitPane; //導入方法依賴的package包/類
/**
* Erzeugt das Panel für die Anzeige der Kunden- und Medien-Tabelle, die
* durch eine Splittpane voneinander getrennt sind.
*
*/
private void erzeugeAuflisterPanel()
{
JPanel auflisterPanel = new JPanel();
_hauptPanel.add(auflisterPanel, BorderLayout.CENTER);
auflisterPanel.setLayout(new BorderLayout());
setNoSize(auflisterPanel);
auflisterPanel.setBackground(UIConstants.BACKGROUND_COLOR);
_auflisterSplitpane = new JSplitPane();
auflisterPanel.add(_auflisterSplitpane, BorderLayout.CENTER);
_auflisterSplitpane.setOrientation(JSplitPane.VERTICAL_SPLIT);
_auflisterSplitpane.setOneTouchExpandable(true);
_auflisterSplitpane.setDividerLocation(300);
setNoSize(_auflisterSplitpane);
_auflisterSplitpane.setContinuousLayout(true);
_auflisterSplitpane.setDoubleBuffered(true);
_auflisterSplitpane.setResizeWeight(0.5);
_auflisterSplitpane.setBackground(UIConstants.BACKGROUND_COLOR);
_auflisterSplitpane
.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
// Kundendarstellung
_auflisterSplitpane.add(_kundenauflisterPanel, JSplitPane.TOP);
// Mediendarstellung
_auflisterSplitpane.add(_medienauflisterPanel, JSplitPane.BOTTOM);
}
示例6: ListWithView
import javax.swing.JSplitPane; //導入方法依賴的package包/類
public ListWithView(boolean enableUpDown, boolean enableAddRemove, TLEAction... additionalActions)
{
this.enableAddRemove = enableAddRemove;
actions = new ArrayList<TLEAction>();
for( TLEAction additionalAction : additionalActions )
{
actions.add(additionalAction);
}
actions.add(upAction);
actions.add(downAction);
actions.add(addAction);
actions.add(removeAction);
final JTextlessButton upButton = new JTextlessButton(upAction);
final JTextlessButton downButton = new JTextlessButton(downAction);
final JButton addButton = new JButton(addAction);
final JButton removeButton = new JButton(removeAction);
list = new JList<>(model);
list.addMouseListener(new ListPopupListener(list, actions));
list.addListSelectionListener(new ListSelectionListener()
{
@Override
public void valueChanged(ListSelectionEvent e)
{
onListSelectionChange();
update();
}
});
final JPanel left = new JPanel(new MigLayout("insets 0, fill, wrap 5, hidemode 2", "[][grow][][][grow]",
"[grow][][][grow][]"));
left.add(new JScrollPane(list), "skip, grow, span 4 4");
left.add(upButton);
left.add(downButton);
left.add(addButton, "skip 3, align right");
left.add(removeButton);
if( !enableUpDown )
{
upButton.setVisible(false);
downButton.setVisible(false);
}
if( !enableAddRemove )
{
addButton.setVisible(false);
removeButton.setVisible(false);
}
// This makes the left-panel more "stable" and reliable in the splitter.
left.setMinimumSize(new Dimension(200, 0));
left.setPreferredSize(left.getMaximumSize());
JSplitPane split = AppletGuiUtils.createSplitPane();
split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
split.setContinuousLayout(true);
split.setResizeWeight(0.1);
split.add(left, JSplitPane.LEFT);
split.add(editorContainer, JSplitPane.RIGHT);
setLayout(new GridLayout(1, 1));
add(split);
update();
}