Enable Scrolling Tabs in a JTabbedPane Container
import javax.swing.JTabbedPane; public class Main { public static void main(String[] argv) throws Exception { JTabbedPane pane = new JTabbedPane(); int rows = pane.getTabRunCount(); int policy = pane.getTabLayoutPolicy(); // WRAP_TAB_LAYOUT pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); } }