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

JColorChooser setSelectionModel with param = null problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 1.2.0
    • client-libs
    • None

      swing JColorChooser setSelectionModel(ColorSelectionModel newModel) with
      param newModel = null you can get unexpected exceptions thrown because the
      selectionModel will be set to null. If the param is null the color selection model should be set to the DefaultColorSelectionModel not null.

      In this situation when the ColorChooser comes up and you select something
      in the dialog you get and exception thrown. Also using other methods that
      use the ColorSelectionModel (ex: setColor(Color color)) you will get an exception thrown.


      Exception Example 1:
      Exception occurred during event dispatching:
      java.lang.NullPointerException
      at javax.swing.colorchooser.DefaultSwatchChooserPanel$MainSwatchListener.mousePressed(DefaultSwatchChooserPanel.java:143)
      at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
      at java.awt.Component.processMouseEvent(Compiled Code)
      at java.awt.Component.processEvent(Compiled Code)
      at java.awt.Container.processEvent(Compiled Code)
      at java.awt.Component.dispatchEventImpl(Compiled Code)
      at java.awt.Container.dispatchEventImpl(Compiled Code)
      at java.awt.Component.dispatchEvent(Compiled Code)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Compiled Code)
      at java.awt.LightweightDispatcher.processMouseEvent(Compiled Code)
      at java.awt.LightweightDispatcher.dispatchEvent(Compiled Code)
      at java.awt.Container.dispatchEventImpl(Compiled Code)
      at java.awt.Window.dispatchEventImpl(Compiled Code)
      at java.awt.Component.dispatchEvent(Compiled Code)
      at java.awt.EventQueue.dispatchEvent(Compiled Code)
      at java.awt.EventDispatchThread.run(Compiled Code)

      Exception Example 2:
      java.lang.NullPointerException
      at javax.swing.JColorChooser.setColor(JColorChooser.java:258)

            mdavidsosunw Mark Davidson (Inactive)
            mcolburnsunw Michael Colburn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: