Java Swing UIManager createTabbedPane(int tabPlacement)

Here you can find the source of createTabbedPane(int tabPlacement)

Description

create Tabbed Pane

License

Academic Free License

Declaration

public static JTabbedPane createTabbedPane(int tabPlacement) 

Method Source Code

//package com.java2s;
//License from project: Academic Free License 

import java.awt.Insets;

import javax.swing.JTabbedPane;

import javax.swing.UIManager;

public class Main {
    public static JTabbedPane createTabbedPane(int tabPlacement) {
        switch (tabPlacement) {
        case JTabbedPane.LEFT:
        case JTabbedPane.RIGHT:
            Object textIconGap = UIManager.get("TabbedPane.textIconGap");
            Insets origInsets = UIManager.getInsets("TabbedPane.tabInsets");
            Insets tabInsets = origInsets;
            if (tabInsets == null) {
                tabInsets = new Insets(2, 2, 2, 2);
            }/*from   w w  w .  j av  a  2s.c  o m*/

            UIManager.put("TabbedPane.textIconGap", new Integer(1));
            UIManager.put("TabbedPane.tabInsets",
                    new Insets(tabInsets.left, tabInsets.top, tabInsets.right, tabInsets.bottom));

            JTabbedPane tabPane = new JTabbedPane(tabPlacement);

            UIManager.put("TabbedPane.textIconGap", textIconGap);
            UIManager.put("TabbedPane.tabInsets", tabInsets);

            return tabPane;
        default:
            return new JTabbedPane(tabPlacement);
        }
    }
}

Related

  1. createErrorLabel(String errorMsg)
  2. createFlow(final Object... components)
  3. createHorizontalAlignment(int scoutAlign)
  4. createHorizontalLine()
  5. createMessageLabel(String message)
  6. decorateMissingValue(JComponent jComponent, boolean missingValueState)
  7. defaultColumnWidth()
  8. destylize(T comp)
  9. disabledIcon(JComponent parent, Icon icon)