NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1551 (closed defect: fixed)

Opened 2012-10-24T15:30:37-05:00

Last modified 2013-01-18T14:23:27-06:00

Exceptions thrown via color buttons

Reported by: bdezonia Owned by: curtis
Priority: major Milestone: imagej2-b7-ndim-data
Component: Core Version:
Severity: serious Keywords:
Cc: dscho Blocked By:


In the imagej-devel mailing list Johannes Schindelin reported:

there is a nasty issue with the {Bg,Fg}ColorButton when showing a
stack without calling createUI() since it tries very, very, very hard to always update the button even if the main window was never shown. The stack trace looks like this:

java.lang.IllegalArgumentException: There is no button associated with the specified tool

at imagej.ui.swing.SwingIconService$SwingIconDrawer.<init>(
at imagej.ui.swing.SwingIconService.acquireDrawer(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at imagej.event.DefaultEventService$ProxySubscriber.onEvent(
at imagej.event.DefaultEventService$ProxySubscriber.onEvent(
at org.bushe.swing.event.ThreadSafeEventService.publish(
at imagej.event.DefaultEventBus.access$201(
at imagej.event.DefaultEventBus$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$400(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

I wonder whether it makes sense to instantiate the ToolsService at all if the main window was not even shown?

See for the full context.

Change History

comment:1 Changed 2013-01-18T14:23:27-06:00 by curtis

  • Status changed from new to closed
  • Resolution set to fixed

I just fixed this as part of another bugfix; see 748d7656. It is not a complete and long-term solution, but I filed a separate ticket for that: #1627.