# HG changeset patch # User peterz # Date 1275039160 -14400 # Node ID 3db39773da2e49383e3813e77851e1dae07048d0 # Parent b89c8108f831acefb67dd254c106de924974120d 6954231: SynthTextPaneUI.installUI() doesn't set component to opaque even if prop was not set by client progr Reviewed-by: alexp diff -r b89c8108f831 -r 3db39773da2e jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java Fri May 28 13:31:38 2010 +0400 +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java Fri May 28 13:32:40 2010 +0400 @@ -779,20 +779,16 @@ if (c instanceof JTextComponent) { editor = (JTextComponent) c; + // common case is background painted... this can + // easily be changed by subclasses or from outside + // of the component. + LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE); + LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE); + // install defaults installDefaults(); installDefaults2(); - // This is a workaround as these should not override what synth has - // set them to - if (! (this instanceof SynthUI)) { - // common case is background painted... this can - // easily be changed by subclasses or from outside - // of the component. - LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE); - LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE); - } - // attach to the model and editor editor.addPropertyChangeListener(updateHandler); Document doc = editor.getDocument(); diff -r b89c8108f831 -r 3db39773da2e jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java Fri May 28 13:31:38 2010 +0400 +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java Fri May 28 13:32:40 2010 +0400 @@ -72,7 +72,28 @@ } /** - * @inheritDoc + * Installs the UI for a component. This does the following + * things. + *
    + *
  1. + * Sets opaqueness of the associated component according to its style, + * if the opaque property has not already been set by the client program. + *
  2. + * Installs the default caret and highlighter into the + * associated component. These properties are only set if their + * current value is either {@code null} or an instance of + * {@link UIResource}. + *
  3. + * Attaches to the editor and model. If there is no + * model, a default one is created. + *
  4. + * Creates the view factory and the view hierarchy used + * to represent the model. + *
+ * + * @param c the editor component + * @see BasicTextUI#installUI + * @see ComponentUI#installUI */ @Override public void installUI(JComponent c) {