A hack for a hack:
you can change the modality of an existing dialog by calling the private method:
java.awt.Dialog.hideAndDisposePreHandler();
To call this private method - as an example:
private void executeMethod(final Class<?> clazz, final String methodName, final Object instance)
{
final Method method =
Iterables.getOnlyElement(Iterables.filter(
Arrays.asList(clazz.getDeclaredMethods()), new Predicate<Method>()
{
public boolean apply(final Method method)
{
return method.getName().equals(methodName);
}
}));
method.setAccessible(true);
try
{
method.invoke(instance);
}
catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
{
throw Throwables.propagate(e);
}
}
(This code requires Guava)
And finally call it:
final Dialog myDialog = ...;
executeMethod(Dialog.class, "hideAndDisposePreHandler", myDialog);