-
Bug
-
Resolution: Cannot Reproduce
-
P5
-
None
-
6u16
-
x86
-
windows_xp
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
Does this problem occur on J2SE 5.0.x or 6.0? Yes / No (pick one)
Yes
Operating System Configuration Information (be specific):
Client: Microsoft Windows XP [Version 5.1.2600]
Bug Description:
BasicTabbedPaneUI is creating htmlViews even when html is not used
The JavaDoc for BasicTabbedPaneUI says 'The Views (one per tab title requiring HTML
rendering) are stored in the htmlViews Vector, which is only allocated after
the first time we run into an HTML tab.' However the code below demonstrates
that htmlViews are created even when there are no HTML Tabs.
Expected: this code to run forever
Actual: eventually an OutOfMemoryError is thrown (due to the htmlViews which
should never have been created in the first place getting bigger every call
to setTitleAt - which is related to bug 6670274)
import javax.swing.*;
public class Test {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
boolean firstTitle = true;
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.addTab("Title 1", new JLabel("Component"));
tabbedPane.updateUI();
while (true) {
firstTitle = !firstTitle;
tabbedPane.setTitleAt(0, firstTitle ? "Title 1" : "Title 2");
}
}
});
}
}
}
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
Does this problem occur on J2SE 5.0.x or 6.0? Yes / No (pick one)
Yes
Operating System Configuration Information (be specific):
Client: Microsoft Windows XP [Version 5.1.2600]
Bug Description:
BasicTabbedPaneUI is creating htmlViews even when html is not used
The JavaDoc for BasicTabbedPaneUI says 'The Views (one per tab title requiring HTML
rendering) are stored in the htmlViews Vector, which is only allocated after
the first time we run into an HTML tab.' However the code below demonstrates
that htmlViews are created even when there are no HTML Tabs.
Expected: this code to run forever
Actual: eventually an OutOfMemoryError is thrown (due to the htmlViews which
should never have been created in the first place getting bigger every call
to setTitleAt - which is related to bug 6670274)
import javax.swing.*;
public class Test {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
boolean firstTitle = true;
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.addTab("Title 1", new JLabel("Component"));
tabbedPane.updateUI();
while (true) {
firstTitle = !firstTitle;
tabbedPane.setTitleAt(0, firstTitle ? "Title 1" : "Title 2");
}
}
});
}
}
}
- relates to
-
JDK-6670274 Incorrect tab titles for JTabbedPane if using HTML (BasicTabbedPanelUI problem)
-
- Closed
-