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


Java JTabbedPane.SCROLL_TAB_LAYOUT屬性代碼示例

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


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

示例1: createLayoutManager

@Override
protected LayoutManager createLayoutManager() {
	if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) {
		// can't override because private class..
		return super.createLayoutManager();
	} else {
		// override for docking framework spacing fix!
		return new BasicTabbedPaneUI.TabbedPaneLayout() {

			@Override
			protected void calculateTabRects(int tabPlacement, int tabCount) {
				final int spacer = -5;
				final int indent = 0;

				super.calculateTabRects(tabPlacement, tabCount);

				for (int i = 1; i < rects.length; i++) {
					// hack to get the tabs closer together. Don't shift leftmost tab(s)
					if (rects[i].x > 0) {
						rects[i].x += i * spacer + indent;
					}
				}
			}
		};
	}

}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:27,代碼來源:TabbedPaneUI.java

示例2: getTabLabelShiftX

@Override
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) {
	if (tabPane.getTabLayoutPolicy() != JTabbedPane.SCROLL_TAB_LAYOUT) {
		if (isSelected) {
			return -5;
		}
	}
	return 0;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:9,代碼來源:TabbedPaneUI.java

示例3: fillWindow

/**
 * Verknüpft alle Tools über ein TabbedPane miteinander.
 */
private void fillWindow()
{
    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);

    tabbedPane.addTab("Application Log", new LogReaderPanel("application.log"));
    tabbedPane.addTab("Error Log", new LogReaderPanel("error.log"));
    tabbedPane.addTab("Config Editor", new ConfigEditorPanel());
    tabbedPane.addTab("Dialog Editor", new DialogEditor());
    tabbedPane.addTab("Tiled Map", new MapPanel());
    tabbedPane.addTab("Pack Game", new PackPanel());
    tabbedPane.addTab("Über", new AboutPanel());

    add(tabbedPane);
}
 
開發者ID:Entwicklerpages,項目名稱:school-game,代碼行數:17,代碼來源:ToolsLauncher.java

示例4: run

@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);
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:9,代碼來源:Test6943780.java

示例5: ExtendedJTabbedPane

public ExtendedJTabbedPane() {
	super(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:3,代碼來源:ExtendedJTabbedPane.java

示例6: BoxLayoutFrame

public BoxLayoutFrame()
{
   super("Demonstrating BoxLayout");

   // create Box containers with BoxLayout
   Box horizontal1 = Box.createHorizontalBox();
   Box vertical1 = Box.createVerticalBox();
   Box horizontal2 = Box.createHorizontalBox();
   Box vertical2 = Box.createVerticalBox();

   final int SIZE = 3; // number of buttons on each Box

   // add buttons to Box horizontal1
   for (int count = 0; count < SIZE; count++)
      horizontal1.add(new JButton("Button " + count));

   // create strut and add buttons to Box vertical1
   for (int count = 0; count < SIZE; count++) 
   {
      vertical1.add(Box.createVerticalStrut(25));
      vertical1.add(new JButton("Button " + count));
   }

   // create horizontal glue and add buttons to Box horizontal2
   for (int count = 0; count < SIZE; count++) 
   {
      horizontal2.add(Box.createHorizontalGlue());
      horizontal2.add(new JButton("Button " + count));
   }

   // create rigid area and add buttons to Box vertical2
   for (int count = 0; count < SIZE; count++) 
   {
      vertical2.add(Box.createRigidArea(new Dimension(12, 8)));
      vertical2.add(new JButton("Button " + count));
   } 

   // create vertical glue and add buttons to panel
   JPanel panel = new JPanel();
   panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

   for (int count = 0; count < SIZE; count++) 
   {
      panel.add(Box.createGlue());
      panel.add(new JButton("Button " + count));
   } 

   // create a JTabbedPane
   JTabbedPane tabs = new JTabbedPane(
      JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT); 

   // place each container on tabbed pane
   tabs.addTab("Horizontal Box", horizontal1);
   tabs.addTab("Vertical Box with Struts", vertical1);
   tabs.addTab("Horizontal Box with Glue", horizontal2);
   tabs.addTab("Vertical Box with Rigid Areas", vertical2);
   tabs.addTab("Vertical Box with Glue", panel);

   add(tabs); // place tabbed pane on frame
}
 
開發者ID:cleitonferreira,項目名稱:LivroJavaComoProgramar10Edicao,代碼行數:60,代碼來源:BoxLayoutFrame.java


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