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

TitledBorder: default title position isn't changed if current Look and Feel has changed

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b12
    • Introduced In Version:
    • Resolved In Build:
      b26
    • CPU:
      generic
    • OS:
      generic

      Description

      jdk version: 6u10
      OS: any

      If an application uses titled borders and starts under Numbus Look and Feel and then sets another Look and Feel (for example, Metal), all titled borders don't change their title positions.

      To reproduce the problem use TitledBorderTest.java from the attachment:
      1. Run the test
      2. Note that it is the Metal Look and Feel and that the title position is ABOVE_TOP instead of CENTER (screenshot WrongTitlePosition.JPG).
      3. Comment the 11th line in the test: // setLaF(LAF.NIMBUS);
      4. Run the test again and note that the title position is correct (screenshot ProperTitlePosition.JPG).

      More specifically:
      If a Look and Feel sets the "TitledBorder.position" UI property and if an application uses this L&F at first and then changes it to another L&F that doesn't set the property, titled border position is turned out wrong. It becomes the same as the default position of the first L&F instead of the default position of the second one.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jasper Jasper Potts (Inactive)
              Reporter:
              mlapshin Mikhail Lapshin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: