Commit 0de31244 authored by Johannes Schindelin's avatar Johannes Schindelin

Avoid VerifyError in headless mode

In headless mode, GenericDialog is not a subclass of java.awt.Frame,
and hence it is not a Container, either.
Signed-off-by: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
parent 37ef16f3
...@@ -67,7 +67,9 @@ public final class WindowTools { ...@@ -67,7 +67,9 @@ public final class WindowTools {
/* Adds AWT scroll bars to the given container. */ /* Adds AWT scroll bars to the given container. */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public static void addScrollBars(Container pane) { public static void addScrollBars(GenericDialog gd) {
if (!(gd instanceof Container)) return; // headless mode
Container pane = (Container) gd;
GridBagLayout layout = (GridBagLayout) pane.getLayout(); GridBagLayout layout = (GridBagLayout) pane.getLayout();
// extract components // extract components
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment