public static JTabbedPane createTabbedPane(int tabPlacement){
switch (tabPlacement) {
case JTabbedPane.LEFT:
case JTabbedPane.RIGHT:
    Object textIconGap=UIManager.get("TabbedPane.textIconGap");
  Insets tabInsets=UIManager.getInsets("TabbedPane.tabInsets");
UIManager.put("TabbedPane.textIconGap",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);
}
}

public static JTabbedPane createTabbedPane ( int tabPlacement ) { switch ( tabPlacement ) { case JTabbedPane . LEFT : case JTabbedPane . RIGHT : Object textIconGap = UIManager . get ( "TabbedPane.textIconGap" ) ; Insets tabInsets = UIManager . getInsets ( "TabbedPane.tabInsets" ) ; UIManager . put ( "TabbedPane.textIconGap" , 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 ) ; } }
creates the tabbed pane .
