Small update to Console class

This commit is contained in:
Ziver Koc 2015-10-20 15:57:17 +00:00
parent a04041c07c
commit e9715298b6
2 changed files with 7 additions and 7 deletions

View file

@ -37,7 +37,7 @@ import java.io.OutputStream;
import java.io.PrintStream; import java.io.PrintStream;
/** /**
* Creates a Swing console window Thats takes System.in and * Creates a Swing console window That takes System.in and
* System.out as Streams and has the ability to stay in the tray * System.out as Streams and has the ability to stay in the tray
* when closed * when closed
* *
@ -86,7 +86,7 @@ public class Console{
console = new JTextPane(); console = new JTextPane();
console.setBackground(Color.black); console.setBackground(Color.black);
console.setForeground(Color.white); console.setForeground(Color.white);
console.setFont(new Font("Lucida Console", Font.BOLD, 12)); console.setFont(new Font("Lucida Console", Font.BOLD, 11));
console.setEditable(false); console.setEditable(false);
console.addKeyListener(listener); console.addKeyListener(listener);
doc = new DefaultStyledDocument(); doc = new DefaultStyledDocument();
@ -133,10 +133,9 @@ public class Console{
} }
/** /**
* Enables the tray * Enables the go down to tray functionality
* *
* @param enable True to enable tray * @param enable if tray icon is enabled
* @param img The Tray image
*/ */
public void enableTray(boolean enable){ public void enableTray(boolean enable){
if(enable && SystemTray.isSupported()){ if(enable && SystemTray.isSupported()){

View file

@ -31,12 +31,13 @@ import java.io.InputStreamReader;
public class ConsoleTest { public class ConsoleTest {
public static void main(String[] args) throws IOException{ public static void main(String[] args) throws IOException{
new Console("Console Test"); Console terminal = new Console("Console Test");
terminal.enableTray(true);
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while(true){ while(true){
System.out.println("hello= "+in.readLine()); System.out.println("hello= "+in.readLine());
for(int i=0; i<20 ;i++){ for(int i=0; i<2 ;i++){
System.out.println(i+"Hello World!!!sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"); System.out.println(i+"Hello World!!!sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss");
System.err.println(i+"Hello World!!!sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"); System.err.println(i+"Hello World!!!sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss");
try { try {