JTabbedPane ensure visible TabHeader

Hello all,

There is a standard JTabbedPane:

tabs =new JTabbedPane();

tabs.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);

Say, I have 20 tabs. Visible from 3 - 7 tab.

Now:

tabs.setSelectedIndex(15);

Nothing happends. I haven't seen any ensureVisible or something like that method. Is there any possibility to scroll to the selected index?

Methods like tabs.getVisibleRect(); return only 0...

Thanks in advance.

[509 byte] By [flexeda] at [2007-11-27 11:18:14]
# 1

I have solved problem. After a new tab addition, pack() method should be called.

flexeda at 2007-7-29 14:29:41 > top of Java-index,Desktop,Core GUI APIs...