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

Problem with javax.swing.JComboBox on GTK theme

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :
      JDK/JRE 1.6.0_04

      ADDITIONAL OS VERSION INFORMATION :
      Linux Ubuntu 7.10, default theme (Human)

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Gnome 2.20.1

      A DESCRIPTION OF THE PROBLEM :
      I use the GTK theme in Swing applications.
      The JComboBox in the GTK theme appears malformed when the GUI becomes visible, and the message below is shown in the console:

      "(<unknown>:32404): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

      (<unknown>:32404): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

      (<unknown>:32404): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed"

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. I open the NetBeans IDE (version 6.0.1);
      2. I create a Desktop application project;
      3. I add a javax.swing.JComboBox component in the JFrame;
      4. I run the project;
      5. When the JFrame becomes visible, the JComboBox added is malformed and the error message appears in the console.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1. I open the NetBeans IDE (version 6.0.1);
      2. I create a Desktop application project;
      3. I add a javax.swing.JComboBox component in the JFrame;
      4. I run the project;
      5. no error must appear in the console.
      ACTUAL -
      Error shown in the console.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      "(<unknown>:32404): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

      (<unknown>:32404): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

      (<unknown>:32404): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed"

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /*
       * Main.java
       *
       */
      package javaapplication;

      import javax.swing.JComboBox;
      import javax.swing.JFrame;
      import javax.swing.UIManager;
      import javax.swing.UnsupportedLookAndFeelException;

      public class Main {

        public static void main(String[] args) {
          try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");

            JFrame frame = new JFrame();
            JComboBox cb = new JComboBox();
            frame.add(cb);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(200, 200);
            frame.setLocation(0, 0);
            frame.setVisible(true);
          } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
          } catch (InstantiationException ex) {
            ex.printStackTrace();
          } catch (IllegalAccessException ex) {
            ex.printStackTrace();
          } catch (UnsupportedLookAndFeelException ex) {
            ex.printStackTrace();
          }
        }
      }

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stayer Kirill Kirichenko (Inactive)
                Reporter:
                ndcosta Nelson Dcosta
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: