Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6789263

JTextPane.setBackground() fails when using GTK LookAndFeel

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0_0"
      OpenJDK Runtime Environment (build 1.6.0_0-b11)
      OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux scylla.ellipsis.cx 2.6.26.5-45.fc9.x86_64 #1 SMP Sat Sep 20 03:23:12 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      When using the GTL LookAndFeel, JTextPane.setBackground() is ignored. It worked
      with Sun Java 1.6.0_07-b06. I've attached a minimal example program which
      exhibits the problem.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the test case.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The background of the JTextPane should be the same color as the surrounding JPanel.
      ACTUAL -
      The background of the JTextPane is white, while the background of the JPanel is grey.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JTextPane;
      import javax.swing.UIManager;
      import javax.swing.border.EmptyBorder;

      public class Test {
        public static void main(String[] args) {
          final JTextPane pane = new JTextPane();
          pane.setText(
            "The background of this text should match the background of the frame");

          pane.setBackground(UIManager.getColor("Panel.background"));

          final JPanel panel = new JPanel();
          panel.setBorder(new EmptyBorder(10,10,10,10));
          panel.add(pane);

          final JFrame frame = new JFrame("Test");
          frame.add(panel);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setVisible(true);
        }
      }
      ---------- END SOURCE ----------

      Release Regression From : 6u7
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

      Attachments

        Activity

          People

            peterz Peter Zhelezniakov
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: