How to Scroll Tabs in JTabbedPane?
Multiple rows are messy, right? So, wouldn't a scroll layout be better just like in the CCleaner? Fine, when you ask me Do i need to hack? I say, NO. There is a method, yes, here it is.
public void setTabLayoutPolicy(int policy);
This method takes either of these two values, SCROLL_TAB_LAYOUT and WRAP_TAB_LAYOUT which have 1 and 0 values respectively. The first one is what does the thing. Let us see it in action.
class JTabbedPaneScroll extends JFrame
private void createAndShowGUI()
JPanel p=new JPanel();
// Now make it scrollable
// or you can call
public static void main(String args)
The greatest compliment you can give me is when you share this with others. I sincerely appreciate it :)