-
Bug
-
Resolution: Fixed
-
P2
-
7
-
b91
-
generic
-
generic
Method SynthTextPaneUI.installUI(JComponent c) says:
Installs the UI for a component. This does the following things.
1. Sets the associated component to opaque ...
Actually it doesn't happen.
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() {
doTheTest();
}
});
}
private static void doTheTest() {
try {
UIManager.setLookAndFeel(new SynthLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
throw new RuntimeException(e);
}
JTextPane textPane = new JTextPane();
SynthTextPaneUI ui = 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());
}
};
textPane.setOpaque(false);
textPane.setUI(ui);
}
}
----------------------------------------------------------------
The output will be:
c.isOpaque() = false
InstallUIComponentOpaque.installUI called
c.isOpaque() = false
Installs the UI for a component. This does the following things.
1. Sets the associated component to opaque ...
Actually it doesn't happen.
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() {
doTheTest();
}
});
}
private static void doTheTest() {
try {
UIManager.setLookAndFeel(new SynthLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
throw new RuntimeException(e);
}
JTextPane textPane = new JTextPane();
SynthTextPaneUI ui = 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());
}
};
textPane.setOpaque(false);
textPane.setUI(ui);
}
}
----------------------------------------------------------------
The output will be:
c.isOpaque() = false
InstallUIComponentOpaque.installUI called
c.isOpaque() = false
- relates to
-
JDK-6954231 SynthTextPaneUI.installUI() doesn't set component to opaque even if prop was not set by client progr
- Resolved