Java Code Examples for javax.swing.JTabbedPane#SCROLL_TAB_LAYOUT

The following examples show how to use javax.swing.JTabbedPane#SCROLL_TAB_LAYOUT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Test6943780.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 2
Source File: Test6943780.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 3
Source File: Test6943780.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 4
Source File: TabbedPaneUI.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) {
	if (tabPane.getTabLayoutPolicy() != JTabbedPane.SCROLL_TAB_LAYOUT && isSelected && !isStartDialogTab && !isFullWidthTab) {
		return -5;
	}
	return 0;
}
 
Example 5
Source File: CloseAndMaxTabbedPane.java    From iBioSim with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the <code>CloseAndMaxTabbedPane</code> with an enhanced UI if
 * <code>enhancedUI</code> parameter is set to <code>true</code>.
 * 
 * @param enhancedUI
 *            whether the tabbedPane should use an enhanced UI
 */
public CloseAndMaxTabbedPane(boolean enhancedUI, Gui biosim) {
	super.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
	this.biosim = biosim;
	if (enhancedUI)
		paneUI = new CloseTabPaneEnhancedUI(biosim);
	else
		paneUI = new CloseTabPaneUI(biosim);

	super.setUI(paneUI);
}
 
Example 6
Source File: CloseTabPaneUI.java    From iBioSim with Apache License 2.0 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
	JTabbedPane tabPane = (JTabbedPane) e.getSource();
	tabPane.revalidate();
	tabPane.repaint();

	if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) {
		int index = tabPane.getSelectedIndex();
		if (index < rects.length && index != -1) {
			tabScroller.tabPanel.scrollRectToVisible(rects[index]);
		}
	}
}
 
Example 7
Source File: DatabaseOperationsPanel.java    From importer-exporter with Apache License 2.0 5 votes vote down vote up
private void init() {
	setLayout(new GridBagLayout());

	workspace = new JXTextField();
	workspace.setPromptForeground(Color.LIGHT_GRAY);
	workspace.setFocusBehavior(FocusBehavior.SHOW_PROMPT);
	datePicker = new DatePicker();
	workspaceLabel = new JLabel();
	timestampLabel = new JLabel();

	add(workspaceLabel, GuiUtil.setConstraints(0,0,0.0,0.0,GridBagConstraints.BOTH,0,0,5,5));
	add(workspace, GuiUtil.setConstraints(1,0,1.0,0.0,GridBagConstraints.HORIZONTAL,0,5,5,5));
	add(timestampLabel, GuiUtil.setConstraints(2,0,0.0,0.0,GridBagConstraints.NONE,0,10,5,5));
	add(datePicker, GuiUtil.setConstraints(3,0,0.0,0.0,GridBagConstraints.HORIZONTAL,0,5,5,0));

	operationsTab = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
	add(operationsTab, GuiUtil.setConstraints(0,2,4,1,1.0,1.0,GridBagConstraints.BOTH,5,0,0,0));

	operations = new DatabaseOperationView[]{
			new ReportOperation(this),
			new BoundingBoxOperation(this, config),
			new IndexOperation(this, config),
			new SrsOperation(this, config),
			new ADEInfoOperation(this)
	};

	for (int i = 0; i < operations.length; ++i)
		operationsTab.insertTab(null, operations[i].getIcon(), null, operations[i].getToolTip(), i);

	operationsTab.addChangeListener(e -> {
		int index = operationsTab.getSelectedIndex();
		for (int i = 0; i < operationsTab.getTabCount(); i++)
			operationsTab.setComponentAt(i, index == i ? operations[index].getViewComponent() : null);
	});

	PopupMenuDecorator.getInstance().decorate(workspace, datePicker.getEditor());
}
 
Example 8
Source File: Test6943780.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 9
Source File: Test6943780.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 10
Source File: Test6943780.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 11
Source File: Test6943780.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 12
Source File: Test6943780.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 13
Source File: Test6943780.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 14
Source File: Test6943780.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 15
Source File: ViewPanel.java    From Robot-Overlord-App with GNU General Public License v2.0 5 votes vote down vote up
public ViewPanel(RobotOverlord ro) {
	super(ro);
	
	tabbedPane = new JTabbedPane(JTabbedPane.TOP,JTabbedPane.SCROLL_TAB_LAYOUT);
	tabbedPane.addFocusListener(this);
	Insets in = tabbedPane.getInsets();
	in.left=5;
	in.top=5;
	in.right=5;
	in.bottom=5;
}
 
Example 16
Source File: Test6943780.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
Example 17
Source File: FlatTabbedPaneUI.java    From FlatLaf with Apache License 2.0 4 votes vote down vote up
private boolean isScrollTabLayout() {
	return tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT;
}
 
Example 18
Source File: ExtendedJTabbedPane.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
public ExtendedJTabbedPane() {
	super(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
}
 
Example 19
Source File: KseFrame.java    From keystore-explorer with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Set tab layout policy - must be one of JTabbedPane.WRAP_TAB_LAYOUT or
 * JTabbedPane.SCROLL_TAB_LAYOUT to take effect.
 *
 * @param tabLayoutPolicy
 *            Tab layout policy
 */
public void setKeyStoreTabLayoutPolicy(int tabLayoutPolicy) {
	if (tabLayoutPolicy == JTabbedPane.WRAP_TAB_LAYOUT || tabLayoutPolicy == JTabbedPane.SCROLL_TAB_LAYOUT) {
		jkstpKeyStores.setTabLayoutPolicy(tabLayoutPolicy);
		applicationSettings.setTabLayout(tabLayoutPolicy);
	}
}
 
Example 20
Source File: JGraphTab.java    From binnavi with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new graph tab component.
 * 
 * @param parent Parent window of the tab component.
 */
public JGraphTab(final CGraphWindow parent) {
  super(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
  m_parent = Preconditions.checkNotNull(parent, "IE01638: Parent argument can not be null");
}