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

JRadioButton that uses HTML does not show focus border

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 1.4.0, 1.4.1
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      x86
    • OS:
      linux, windows_2000

      Description

      Name: jk109818 Date: 01/14/2003


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

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]
      Service Pack 3

      A DESCRIPTION OF THE PROBLEM :
      A JRadioButton that uses plain text shows a focus border when it has focus. I expect the same behavior if a
      JRadioButton uses HTML, but in that case it doesn't show the border. It has the focus, it just doesn't appear to.
      This is not related to "focusPainted" being set to false. It happens when it's true.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a JRadioButton, with HTML text as the label (surround text with "<html>...</html>".
      2. Make sure its "focusPainted" property is set to true (default).
      3. Tab through your panel until the radio button should have focus.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected results: The radio button should have a focus border around it, just like radio buttons that use plain text
      do.

      Actual results: The radio button doesn't have a border. There is no indication that it has focus. (But I know it
      does because if I hit the space bar, it selects the radio button.)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      /**
       * Tests the focus border of HTML radiobuttons.
       */
      public class RBTest extends JDialog {
      public static void main(String[] args) {
      new RBTest();
      }

      public RBTest() {
      super();
      setModal(true);
      getContentPane().setLayout(new GridLayout(0, 1));
      // This first one WILL have a focus border because it's not HTML
      getContentPane().add(new JRadioButton(
      "This is non-html text"));
      // This one will NOT have a focus border, but it SHOULD look just like
      // the first one
      getContentPane().add(new JRadioButton(
      "<html>This is <b>html</b> text</html>"));
      pack();
      setVisible(true);
      System.exit(0);
      }
      }
      ---------- END SOURCE ----------
      (Review ID: 180014)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jkimsunw Jeffrey Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Imported:
                Indexed: