Package mikera.gui

Examples of mikera.gui.JConsole


import mikera.util.Rand;

public class ConsoleApp {

    public static void main(String[] args) { 
      JConsole jc=new JConsole(100,40);
      jc.setCursorVisible(true);
      jc.setCursorBlink(true);
      jc.write("Hello World\n");
      jc.write("Hello World\n",Color.BLACK,Color.MAGENTA);
      jc.write("Hello World\n",Color.GREEN,Color.BLACK);

      System.out.println("Normal output");
      jc.captureStdOut();
      System.out.println("Captured output");
     
     
      // brown box
      jc.fillArea(' ', Color.WHITE, new Color(100,70,30), 20, 20, 3, 3);
     
      jc.setCursorPos(0, 0);

      Frames.display(jc,"JConsole test application");
     
      int SECS=3;
      long start=System.currentTimeMillis();
      int iterations=0;
     
      while (start>(System.currentTimeMillis()-1000*SECS)) {
        for (int y=10; y<20; y++) {
          for (int x=10; x<80; x++) {
            jc.fillArea((char)Rand.r(256),
                Colours.getColor(Rand.nextInt()),
                Colours.getColor(Rand.nextInt()),
                x, y, 1, 1);
          }
        }
        jc.repaint();
        iterations++;
      }
     
      jc.setCursorPos(0, 6);
      System.out.println("FPS="+iterations/SECS);
    }
View Full Code Here

TOP

Related Classes of mikera.gui.JConsole

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.