-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
7
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b142)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b12, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
In the current Java 6 release, the tabs are decorated. Although the underline is missing (see bug ID 6747580), the tab pane is still usable. The Java 7 tabs are nearly unusable. (If the code below did not explicitly set a background colour on the tab pane, the tabs would be invisible!)
REGRESSION. Last worked in version 6u25
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Set Nimbus Look and Feel.
2. Create a JTabbedPane with SCROLL_TAB_LAYOUT.
3. Add a component to the pane (so that it has at least one tab).
4. Add the tabbed pane to a window and display the window.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The tab pane should be decorated in the Nimbus Look and Feel style.
ACTUAL -
The tabs are simply filled with the tab pane's background colour, which is normally the same as the background colour of the enclosing panel. The result that the tab pane appears to be a row of text labels.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package nimbustabbug;
import javax.swing.UIManager;
import javax.swing.plaf.nimbus.NimbusLookAndFeel;
public class NimbusTabBug extends javax.swing.JFrame {
public NimbusTabBug() {
initComponents();
}
@SuppressWarnings( "unchecked" )
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
scrollTab = new javax.swing.JTabbedPane();
jLabel1 = new javax.swing.JLabel();
wrapTab = new javax.swing.JTabbedPane();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new java.awt.GridLayout(0, 2, 4, 4));
scrollTab.setBackground(java.awt.Color.white);
scrollTab.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("SCROLL_TAB_LAYOUT");
scrollTab.addTab("Tab", jLabel1);
getContentPane().add(scrollTab);
wrapTab.setBackground(java.awt.Color.white);
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("WRAP_TAB_LAYOUT");
wrapTab.addTab("Tab", jLabel2);
getContentPane().add(wrapTab);
pack();
}// </editor-fold>
public static void main( String args[] ) {
java.awt.EventQueue.invokeLater( new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel( new NimbusLookAndFeel() );
new NimbusTabBug().setVisible( true );
} catch( Throwable t ) {
t.printStackTrace();
}
}
} );
}
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JTabbedPane scrollTab;
private javax.swing.JTabbedPane wrapTab;
// End of variables declaration
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
In some cases it may be possible to use WRAP_TAB_POLICY, but this does not work for many use cases (e.g., a row of document tabs). In these cases the only workaround would seem to be to implement your own UI class to paint the component.
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b142)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b12, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
In the current Java 6 release, the tabs are decorated. Although the underline is missing (see bug ID 6747580), the tab pane is still usable. The Java 7 tabs are nearly unusable. (If the code below did not explicitly set a background colour on the tab pane, the tabs would be invisible!)
REGRESSION. Last worked in version 6u25
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Set Nimbus Look and Feel.
2. Create a JTabbedPane with SCROLL_TAB_LAYOUT.
3. Add a component to the pane (so that it has at least one tab).
4. Add the tabbed pane to a window and display the window.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The tab pane should be decorated in the Nimbus Look and Feel style.
ACTUAL -
The tabs are simply filled with the tab pane's background colour, which is normally the same as the background colour of the enclosing panel. The result that the tab pane appears to be a row of text labels.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package nimbustabbug;
import javax.swing.UIManager;
import javax.swing.plaf.nimbus.NimbusLookAndFeel;
public class NimbusTabBug extends javax.swing.JFrame {
public NimbusTabBug() {
initComponents();
}
@SuppressWarnings( "unchecked" )
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
scrollTab = new javax.swing.JTabbedPane();
jLabel1 = new javax.swing.JLabel();
wrapTab = new javax.swing.JTabbedPane();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new java.awt.GridLayout(0, 2, 4, 4));
scrollTab.setBackground(java.awt.Color.white);
scrollTab.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("SCROLL_TAB_LAYOUT");
scrollTab.addTab("Tab", jLabel1);
getContentPane().add(scrollTab);
wrapTab.setBackground(java.awt.Color.white);
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("WRAP_TAB_LAYOUT");
wrapTab.addTab("Tab", jLabel2);
getContentPane().add(wrapTab);
pack();
}// </editor-fold>
public static void main( String args[] ) {
java.awt.EventQueue.invokeLater( new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel( new NimbusLookAndFeel() );
new NimbusTabBug().setVisible( true );
} catch( Throwable t ) {
t.printStackTrace();
}
}
} );
}
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JTabbedPane scrollTab;
private javax.swing.JTabbedPane wrapTab;
// End of variables declaration
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
In some cases it may be possible to use WRAP_TAB_POLICY, but this does not work for many use cases (e.g., a row of document tabs). In these cases the only workaround would seem to be to implement your own UI class to paint the component.
- duplicates
-
JDK-7034619 Scrollable Tabs don't appear with JDK7 Synth based LaF, different from Java 5/6
-
- Closed
-