X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FConsole.java;h=6a6cb56974e0289de085cec4e15b8d6d398c4541;hb=1d4324b37f248818b6bf5ba18e144f57299dc308;hp=d9d729ab93a3ae0fed7d348ce704e493a608af58;hpb=cb8e52fbbc5f725e3f7f48c672cdddb0690bd978;p=jalview.git diff --git a/src/jalview/gui/Console.java b/src/jalview/gui/Console.java index d9d729a..6a6cb56 100644 --- a/src/jalview/gui/Console.java +++ b/src/jalview/gui/Console.java @@ -114,6 +114,7 @@ public class Console extends WindowAdapter Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); frame = initFrame("Java Console", screenSize.width / 2, screenSize.height / 2, -1, -1); + frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); initConsole(true); } @@ -220,7 +221,8 @@ public class Console extends WindowAdapter { if (jalview.bin.Console.log != null) { - jalview.bin.Console.log.setLevel((LogLevel) logLevelCombo.getSelectedItem()); + jalview.bin.Console.log + .setLevel((LogLevel) logLevelCombo.getSelectedItem()); } } @@ -431,20 +433,20 @@ public class Console extends WindowAdapter // you may omit this part for your application // - System.out.println("Hello World 2"); - System.out.println("All fonts available to Graphic2D:\n"); + jalview.bin.Console.outPrintln("Hello World 2"); + jalview.bin.Console.outPrintln("All fonts available to Graphic2D:\n"); GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); String[] fontNames = ge.getAvailableFontFamilyNames(); for (int n = 0; n < fontNames.length; n++) { - System.out.println(fontNames[n]); + jalview.bin.Console.outPrintln(fontNames[n]); } // Testing part: simple an error thrown anywhere in this JVM will be printed // on the Console // We do it with a seperate Thread becasue we don't wan't to break a Thread // used by the Console. - System.out.println("\nLets throw an error on this console"); + jalview.bin.Console.outPrintln("\nLets throw an error on this console"); errorThrower = new Thread(this); errorThrower.setDaemon(true); errorThrower.start(); @@ -510,7 +512,8 @@ public class Console extends WindowAdapter JalviewAppender jappender = new JalviewAppender(level); JalviewAppender.setTextArea(textArea); jappender.start(); - if (jalview.bin.Console.log != null && jalview.bin.Console.log instanceof JLoggerLog4j) + if (jalview.bin.Console.log != null + && jalview.bin.Console.log instanceof JLoggerLog4j) { JLoggerLog4j.addAppender(jalview.bin.Console.log, jappender); } @@ -549,10 +552,12 @@ public class Console extends WindowAdapter { } } + /* if (!frame.isVisible()) { frame.dispose(); } + */ // System.exit(0); }