当前位置: 首页>>代码示例>>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;未经允许,请勿转载。