setKeyBindings(frame);
- desktop.add(frame);
+ // Since the latest FlatLaf patch, we occasionally have problems showing structureViewer frames...
+ int tries=3;
+ boolean shown=false;
+ Exception last=null;
+ do
+ {
+ try
+ {
+ desktop.add(frame);
+ shown=true;
+ } catch (IllegalArgumentException iaex)
+ {
+ last=iaex;
+ tries--;
+ jalview.bin.Console.info(
+ "Squashed IllegalArgument Exception (" + tries + " left) for "+frame.getTitle(),
+ iaex);
+ try
+ {
+ Thread.sleep(5);
+ } catch (InterruptedException iex)
+ {
+ }
+ ;
+ }
+ } while (!shown && tries > 0);
+ if (!shown)
+ {
+ jalview.bin.Console.error("Serious Problem whilst showing window "+frame.getTitle(),last);
+ }
windowMenu.add(menuItem);