-
Bug
-
Resolution: Fixed
-
P2
-
7
-
b97
-
generic
-
generic
Method SynthTextPaneUI.installUI(JComponent c) says:
"... Sets the associated component to opaque
if the opaque property has not already been set
by the client program. ..."
Actually it doesn't happen.
Please see the following code sample:
---
import javax.swing.*;
import javax.swing.plaf.synth.*;
public class InstallUIComponentOpaque {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override public void run() {
try {
UIManager.setLookAndFeel(new SynthLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
throw new RuntimeException(e);
}
new JTextPane().setUI(new SynthTextPaneUI() {
@Override public void installUI(JComponent c) {
System.out.println("c.isOpaque() = " + c.isOpaque());
super.installUI(c);
System.out.println("InstallUIComponentOpaque.installUI called");
System.out.println("c.isOpaque() = " + c.isOpaque());
}
});
}
});
}
}
---
For JDK7 b93 output will be:
c.isOpaque() = false
InstallUIComponentOpaque.installUI called
c.isOpaque() = false
For JDK7 b98 the output is still
c.isOpaque() = false
InstallUIComponentOpaque.installUI called
c.isOpaque() = false
"... Sets the associated component to opaque
if the opaque property has not already been set
by the client program. ..."
Actually it doesn't happen.
Please see the following code sample:
---
import javax.swing.*;
import javax.swing.plaf.synth.*;
public class InstallUIComponentOpaque {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override public void run() {
try {
UIManager.setLookAndFeel(new SynthLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
throw new RuntimeException(e);
}
new JTextPane().setUI(new SynthTextPaneUI() {
@Override public void installUI(JComponent c) {
System.out.println("c.isOpaque() = " + c.isOpaque());
super.installUI(c);
System.out.println("InstallUIComponentOpaque.installUI called");
System.out.println("c.isOpaque() = " + c.isOpaque());
}
});
}
});
}
}
---
For JDK7 b93 output will be:
c.isOpaque() = false
InstallUIComponentOpaque.installUI called
c.isOpaque() = false
For JDK7 b98 the output is still
c.isOpaque() = false
InstallUIComponentOpaque.installUI called
c.isOpaque() = false
- relates to
-
JDK-6922179 SynthTextPaneUI.installUI() doesn't set component to opaque as specified
- Resolved