-
Bug
-
Resolution: Fixed
-
P4
-
8u60, 9
-
b116
-
os_x
JDK 8u60, OSX, Aqua L&F
The more tabs are added to JTabbedPane the higher is pane.getMinimumSize().height even though the tabs are in one row and should not have any impact on the component's height.
The following sample code shows the behaviour.
package aquatest;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
public class AquaTabbedPaneTest {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTabbedPane pane = new JTabbedPane();
pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
f.add(pane);
for (int i = 0; i < 20; i++) {
String title = "Tab" + (i + 1);
pane.addTab(title, new JPanel());
if (i < 5 || i == 9 || i == 19) {
System.out.format("Tabs: %4d Minimal height: %5d\n",
i + 1, pane.getMinimumSize().height);
}
}
}
}
The more tabs are added to JTabbedPane the higher is pane.getMinimumSize().height even though the tabs are in one row and should not have any impact on the component's height.
The following sample code shows the behaviour.
package aquatest;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
public class AquaTabbedPaneTest {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTabbedPane pane = new JTabbedPane();
pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
f.add(pane);
for (int i = 0; i < 20; i++) {
String title = "Tab" + (i + 1);
pane.addTab(title, new JPanel());
if (i < 5 || i == 9 || i == 19) {
System.out.format("Tabs: %4d Minimal height: %5d\n",
i + 1, pane.getMinimumSize().height);
}
}
}
}