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

ComboBox does not display focus outline in GTK L&F

    Details

    • Subcomponent:
    • Resolved In Build:
      b45
    • CPU:
      generic, x86
    • OS:
      linux, solaris_nevada

      Backports

        Description

        FULL PRODUCT VERSION :


        ADDITIONAL OS VERSION INFORMATION :
        Ubuntu 11.10 32bit

        A DESCRIPTION OF THE PROBLEM :
        Run follow test case on Linux with Gnome desktop environment, use tab to navigator between controls, when a ComboBox component gets focused, the out line graphic which indicates focus is not painted.
          To compare the behavior, please run the test case in Nimbus L&F.

        Test case

        /*
         * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
         *
         * This code is free software; you can redistribute it and/or modify it
         * under the terms of the GNU General Public License version 2 only, as
         * published by the Free Software Foundation.
         *
         * This code is distributed in the hope that it will be useful, but WITHOUT
         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
         * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
         * version 2 for more details (a copy is included in the LICENSE file that
         * accompanied this code).
         *
         * You should have received a copy of the GNU General Public License version
         * 2 along with this work; if not, write to the Free Software Foundation,
         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
         *
         * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
         * or visit www.oracle.com if you need additional information or have any
         * questions.
         */

        /*
         * Portions Copyright (c) 2012 IBM Corporation
         */

        import java.awt.Container;
        import java.awt.GridLayout;
        import javax.swing.JButton;
        import javax.swing.JComboBox;
        import javax.swing.JFrame;
        import javax.swing.UIManager;

        public class JComboBoxFocusTest extends JFrame {

            JComboBoxFocusTest() {
                setVisible(true);
                setBounds(0, 0, 800, 600);
                
                Container pane = getContentPane();
                pane.setBounds(0, 0, 800, 600);
                pane.setLayout(new GridLayout());

                JButton jb1 = new JButton("Button1");
                jb1.setFocusable(true);
                pane.add(jb1);

                JComboBox comb1 = new JComboBox();
                comb1.addItem("Hello");
                comb1.addItem("world");
                comb1.setFocusable(true);
                pane.add(comb1);

                JButton jb2 = new JButton("Button1");
                jb2.setFocusable(true);
                pane.add(jb2);

                JComboBox comb2 = new JComboBox();
                comb2.addItem("Hello");
                comb2.addItem("world");
                comb2.setFocusable(true);
                pane.add(comb2);
                pane.setFocusCycleRoot(true);

                pack();
                setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            }

            public static void main(String[] args) {
                try {
                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
                } catch (Exception e) {
                    System.err
                            .println("This testcase is only valid on GTK environment");
                }
                new JComboBoxFocusTest();
            }
        }



        REPRODUCIBILITY :
        This bug can be reproduced always.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rupashka Pavel Porvatov (Inactive)
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: