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

JComboBox under Gnome/Nimbus L&F doesn't paint focus indicator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • solaris_11
    • client-libs
    • generic
    • solaris_nevada

      When I run a simple Swing app with a JComboBox under Gnome/Nimbus, I don't see any indication of focus when the JComboBox has focus. The attached screenshot, generated with the following code, shows a JComboBox with focus, but no focus indicator:

      import java.awt.BorderLayout;
      import javax.swing.*;

      public class Fred {
          public static void main(String args[]) {
      int gap = 15;
      JButton b = new JButton("Hello");
      JComboBox combo = new JComboBox(new Object[] {"one", "two", "three"});

      JFrame frame = new JFrame();
      JPanel cont = new JPanel();
      cont.setBorder(BorderFactory.createEmptyBorder(gap, gap, gap, gap));
      cont.setLayout(new BorderLayout(gap, gap));
      cont.add(b, BorderLayout.CENTER);
      cont.add(combo, BorderLayout.SOUTH);

      frame.getContentPane().add(cont);

      frame.setLocationByPlatform(true);
      frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
      frame.pack();
      frame.setVisible(true);
          }
      }

            peterz Peter Zhelezniakov
            stalley Stephen Talley (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: