當前位置: 首頁>>代碼示例>>Java>>正文


Java JSplitPane.add方法代碼示例

本文整理匯總了Java中javax.swing.JSplitPane.add方法的典型用法代碼示例。如果您正苦於以下問題:Java JSplitPane.add方法的具體用法?Java JSplitPane.add怎麽用?Java JSplitPane.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JSplitPane的用法示例。


在下文中一共展示了JSplitPane.add方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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();
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:33,代碼來源:SecurityTree.java

示例2: DialogEditor

import javax.swing.JSplitPane; //導入方法依賴的package包/類
public DialogEditor()
{
    super(new BorderLayout());

    root = new DefaultMutableTreeNode("Level");
    buildTree();
    treeView = new JTree(root);
    addTreeChangeListener();

    fillCreateLevelPanel();
    containerPanel.add(createLevelPanel);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splitPane.add(new JScrollPane(treeView));
    splitPane.add(containerPanel);
    splitPane.setResizeWeight(0.25);

    add(splitPane, BorderLayout.CENTER);

    JPanel saveBar = new JPanel(new GridLayout(1, 2));

    newButton = new JButton("Neu");
    newButton.addActionListener(this);

    loadButton = new JButton("Laden");
    loadButton.addActionListener(this);

    saveButton = new JButton("Speichern");
    saveButton.addActionListener(this);
    saveButton.setEnabled(false);

    saveBar.add(newButton);
    saveBar.add(loadButton);
    saveBar.add(saveButton);

    add(saveBar, BorderLayout.SOUTH);
}
 
開發者ID:Entwicklerpages,項目名稱:school-game,代碼行數:38,代碼來源:DialogEditor.java

示例3: 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);
}
 
開發者ID:polemonium,項目名稱:SE2Project,代碼行數:32,代碼來源:AusleiheUI.java

示例4: SplitCompilationViewer

import javax.swing.JSplitPane; //導入方法依賴的package包/類
public SplitCompilationViewer(CompilationViewer firstViewer, CompilationViewer secondViewer) {
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    firstPanel = createComponent(firstViewer);
    secondPanel = createComponent(secondViewer);
    splitPane.add(firstPanel);
    splitPane.add(secondPanel);
    splitPane.addPropertyChangeListener(splitChanged);
    splitPane.setDividerLocation(getLastDividerLocation());
    combinedLookup = new ProxyLookup(firstViewer.getLookup(), secondViewer.getLookup());
}
 
開發者ID:arodchen,項目名稱:MaxSim,代碼行數:11,代碼來源:SplitCompilationViewer.java

示例5: AssociationRuleTableViewer

import javax.swing.JSplitPane; //導入方法依賴的package包/類
public AssociationRuleTableViewer(AssociationRules rules) {
	if (rules != null && rules.getNumberOfRules() > 0) {
		this.model = new AssociationRuleTableModel(rules);
		setLayout(new BorderLayout());
		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
		splitPane.setBorder(null);

		// conclusion list
		AssociationRuleFilter filter = new AssociationRuleFilter(rules);
		filter.addAssociationRuleFilterListener(this);
		filter.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 5));
		splitPane.add(filter, 0);

		// main panel
		{
			JPanel mainPanel = new JPanel();
			mainPanel.setOpaque(true);
			mainPanel.setBackground(Colors.WHITE);
			GridBagLayout layout = new GridBagLayout();
			mainPanel.setLayout(layout);
			GridBagConstraints c = new GridBagConstraints();
			c.fill = GridBagConstraints.BOTH;
			c.weightx = 1;
			c.weighty = 1;
			c.gridwidth = GridBagConstraints.REMAINDER;
			c.insets = new Insets(15, 10, 10, 10);

			table.setModel(model);
			table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);
			table.setRowHighlighting(true);
			JScrollPane tablePane = new ExtendedJScrollPane(table);
			tablePane.setBorder(null);
			tablePane.setBackground(Colors.WHITE);
			tablePane.getViewport().setBackground(Colors.WHITE);
			layout.setConstraints(tablePane, c);
			mainPanel.add(tablePane);

			setColumnSizes();

			splitPane.add(mainPanel, 1);
		}
		filter.triggerFilter();

		add(splitPane, BorderLayout.CENTER);
	} else {
		add(ResultDisplayTools.createErrorComponent("No rules found"), BorderLayout.CENTER);
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:49,代碼來源:AssociationRuleTableViewer.java

示例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();
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:69,代碼來源:ListWithView.java


注:本文中的javax.swing.JSplitPane.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。