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

1.4 REGRESSION: Compound TitledBorder not opaque

XMLWordPrintable



      Name: sv35042 Date: 10/08/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


      FULL OPERATING SYSTEM VERSION :
      SunOS ganymed 5.7 Generic_106541-17 sun4u sparc
      SUNW,Ultra-5_10


      ADDITIONAL OPERATING SYSTEMS : linux



      A DESCRIPTION OF THE PROBLEM :
      Creating a compound TitledBorder containing another
      right-aligned TitledBorder over an EtchedBorder paints the
      topmost title over the etched border without erasing the
      background.

      In 1.3 and before the left-aligned border was opaque.


      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Run the simple example demonstrating how the border has
      been assembled.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected: An etched border with two title texts each with
      opaque background.

      Actual: The left title is transparent, overlapping the
      etched border.

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;
      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JLabel;
      import javax.swing.border.TitledBorder;
      import javax.swing.border.EtchedBorder;

      public class BorderTest
      {
        public static void main(String[] args)
        {
          // create an etched border with left and right texts
          EtchedBorder etched = new EtchedBorder();
          TitledBorder count = new TitledBorder( etched, " 123 ",
            TitledBorder.RIGHT, TitledBorder.TOP );
          TitledBorder border = new TitledBorder( count, " Title " );
          // add the border to a panel
          JPanel panel = new JPanel();
          panel.add( new JLabel("Hello World!") );
          panel.setBorder( border );
          // create a window for it
          JFrame frame = new JFrame();
          frame.addWindowListener( new WindowAdapter()
          {
            public void windowClosing(WindowEvent e) { System.exit(0); }
          } );
          frame.getContentPane().add( panel );
          frame.pack();
          frame.setVisible(true);
        }
      }

      ---------- END SOURCE ----------

      Release Regression From : 1.4
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 143739)
      ======================================================================

            malenkov Sergey Malenkov (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: