Sustitution of System.out.println in Graphical mode

Dear Sirs:
I am changing my applications to graphical mode. I would like to know what is the command that substitutes System.out.println in graphical mode. Thanks in advance

I am not sure exactly what you mean when you say you are changing your apps to graphical mode,
I assume you will be using Swing?
If you will be using a gui in the place of a command prompt program, you may need to completely redesign your app (I'm not sure I can help you with that).
In a Java applet, and application, you can still use System.out.println. It will print to the console while your app runs. I use it pretty often for simple debugging (Although I use JBuilder and the option for the execution Log, if you are in windows and expect the size of the errors to be large an don't have something like this, you may want to run the output into a file using the IO package).
Hope this helps you,
Dan Hughes
Dear Sirs:
I am changing my applications to graphical mode. I
would like to know what is the command that
substitutes System.out.println in graphical mode.
Thanks in advance

Similar Messages

  • How do you change system.out.println colour?

    Hi, I am developing some basic rmi client/server applications, I have an 2D array on a central server being read/written by remote clients. all the development is using system.out. statements at the moment (hopefully being replaced by GUI later) my question is when a client remote calls a read operation, and reads an array location, eg x3, y4 I want to print the location contents in a different colour to indicate the read, at the moment the displayArray() simply has nested for loops to cycle through the array and System.out.println statements to get it to the screen. I wonder is there a simple way to change the colour of system.out type statements? thanks for any help

    I could be wrong, but I don't think that is possible. The System.out and other streams are just streams of characters, and doesn't contain any data about the characters. You could possibly get it to work if you knew which terminal the stream was going to and if the terminal had escape commands that could set colors. BBS browsers have that functionality, but I think that would be a hard path to follow.
    If you are printing out a lot of data and need some color to aid it's readability, try printing directly to your graphic context:
    Graphics g = getGraphics();
    g.setColor(Color.white);
    g.drawString("Hello",100,100);

  • Where does System.out.println go?

    Hi Everyone: I know I've seen this topic before, but I'm still having some trouble. I would like to debug my EJBs, and so I've added some System.out.println statements to them. Where does that go? I've looked at the defaultTrace.trc files in the
    C:\usr\sap\P48\JC00\j2ee\cluster\server0\log
    folder, and haven't found any of the text that I think I am writing. I appreciate any guidance! Ian.

    Hi lan,
    I was facing the same question earlier, and now I think I have figured out one possible answer. Actually, where the System.out.println goes is up to the Server Admin to config. There is a default SYSTEM.OUT log controller ( under location controller side) pre-defined to cater for all System.out.println(). All the System.out.println() output is considered as INFO type log message. However, this default SYSTEM.OUT controller is not assigned with any real log destination, thus, we cannot find the output anywhere.
    If you goes to the log configurator (using Visual Admin), you can locate this SYSTEM.OUT controller , and add in a default (Anonymous) destionation for it . (you need to toggle on the advance edit mode from the top menu , then you can add modify the destination settings of a Controller).
    For Anonymous destionation, the println() output will sure go to the defaultTrace.trc (better view it using Log Viewer, instead of viewing it from the log file ).
    Or , you can define a separate file (e.g. c:\temp\myStd.log ) as the log destination ..
    Last but not the least, you need to set the ForceSingleTraceFile setting from 'YES' to 'NO' , then you can see your "myStd.log".
    To change the ForceSingleTraceFile , go to Visual Admin, J2EE server --> Kernel --> LogManager.
    Hope you find the above useful.

  • System.out.println ....syntax error?

    Hi,
    I am workin on my first java program here...and althought my classes compile just fine I can't manage to get what I want to appear on the screen on Button action....
    Clicking on cost should trigger the appearance of the total cost...but nothing happens.
    Can you have a look and tell me where I went wrong please?
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    public class Booking extends Applet implements ItemListener,ActionListener
    String[][] c = { {"French Language","250","130","70"}, {"Painting","270","140","70"}, {"Yoga","250","130","70"} };
    Courses courses_list = new Courses(c);
    Choice ChoiceCourse;
    Choice ChoicePeople;
    Checkbox cb1, cb2, cb3;
    boolean fulltime = false;
    boolean parttime = false;
    boolean concessions = false;
    Button b1;
    int c1;
    int p1;
    int price;
    public void init()
      add(new Label("Courses available for booking : "));
      ChoiceCourse = new Choice();
      add(ChoiceCourse);
    //the following populates the ChoiceCourse dropDown Menu with the Courses'Titles
      int i=0;
      while (i<c.length)
        ChoiceCourse.addItem(courses_list.getTitle(i));
        i++;
      ChoiceCourse.addItemListener(this);
      add(new Label("Number of participants for the course selected : "));
      ChoicePeople = new Choice();
      add(ChoicePeople);
    //the following populates the ChoicePeople dropDown Menu with "numbers" from 1 to 10
      int j=1;
      while (j<11)
        ChoicePeople.addItem(new Integer(j).toString());
        j++;
      ChoicePeople.addItemListener(this);
      cb1 = new Checkbox ("Full-Time");
      add(cb1);
      cb2 = new Checkbox ("Part-Time");
      add (cb2);
      cb3 = new Checkbox ("Concessions");
      add (cb3);
      b1 = new Button ("Cost");
      add (b1);
      b1.addActionListener(this);
      public void itemStateChanged(ItemEvent e)
       if (e.getSource() == ChoiceCourse)
         String c2 = (String) e.getItem();  // When ChoiceCourse is modified
         if (c2 == "French Language")
           int c1 = 0;
         if (c2 == "Painting")
           int c1 = 1;
         else
           int c1 = 2;
       if (e.getSource() == ChoicePeople)
         String p2 = (String) e.getItem();  // When ChoicePeople is modified
         int p1=Integer.parseInt(p2);       // converts the String into an integer
      public void actionPerformed(ActionEvent e)
        if ( e.getActionCommand() == "Cost" )
          fulltime = cb1.getState();
          parttime = cb2.getState();
          concessions = cb3.getState();
          if (fulltime == true)
            int price = 1;
          if (parttime == true)
            int price = 2;
          else
            int price = 3;
          int mode =  Integer.parseInt(c[c1][price]);  
          System.out.println("total cost of your selection is: �" + courses_list.getCost(p1,mode));
    }

    Thanks for the guidance and the explanations. I've improved my code according to your recommendations (1, 2 &3) and it compiles just fine.
    However, the println still doesn't work...but there is improvement:
    When I run my applet using the AppletViewer at the very end I get a log of what happened...and it's now showing:
    "D:\JBuilder8\jdk1.4\bin\appletviewer.exe Booking.html
    total cost of your selection is: �0"
    Which means that the println is being called but is not printing where it should be (on my screen)....the other problem is that it is obviously not properly calculating the total cost since it shouldn't be �0.
    Here is my new (improved) code, and below is the code for the Courses class (which does some of the calculation):
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    public class Booking extends Applet implements ItemListener,ActionListener
    String[][] c = { {"French Language","250","130","70"}, {"Painting","270","140","70"}, {"Yoga","250","130","70"} };
    Courses courses_list = new Courses(c);
    Choice ChoiceCourse;
    Choice ChoicePeople;
    Checkbox cb1, cb2, cb3;
    boolean fulltime = false;
    boolean parttime = false;
    boolean concessions = false;
    Button b1;
    int c1;
    int p1;
    int price;
    public void init()
      add(new Label("Courses available for booking : "));
      ChoiceCourse = new Choice();
      add(ChoiceCourse);
    //the following populates the ChoiceCourse dropDown Menu with the Courses'Titles
      int i=0;
      while (i<c.length)
        ChoiceCourse.addItem(courses_list.getTitle(i));
        i++;
      ChoiceCourse.addItemListener(this);
      add(new Label("Number of participants for the course selected : "));
      ChoicePeople = new Choice();
      add(ChoicePeople);
    //the following populates the ChoicePeople dropDown Menu with "numbers" from 1 to 10
      int j=1;
      while (j<11)
        ChoicePeople.addItem(new Integer(j).toString());
        j++;
      ChoicePeople.addItemListener(this);
      cb1 = new Checkbox ("Full-Time");
      add(cb1);
      cb2 = new Checkbox ("Part-Time");
      add (cb2);
      cb3 = new Checkbox ("Concessions");
      add (cb3);
      b1 = new Button ("Cost");
      add (b1);
      b1.addActionListener(this);
      public void itemStateChanged(ItemEvent e)
       if (e.getSource().equals (ChoiceCourse)) //should this be == or .equals? it doesn't work either way but compiles
         String c2 = (String) e.getItem();  // When ChoiceCourse is modified
         if (c2.equals ("French Language"))
           c1 = 0;
         if (c2.equals ("Painting"))
           c1 = 1;
         else
           c1 = 2;
       if (e.getSource().equals (ChoicePeople)) //should this be == or .equals?it doesn't work either way but compiles
         String p2 = (String) e.getItem();  // When ChoicePeople is modified
         p1=Integer.parseInt(p2);       // converts the String into an integer
      public void actionPerformed(ActionEvent e)
        if ( e.getActionCommand().equals ("Cost") )
          fulltime = cb1.getState();
          parttime = cb2.getState();
          concessions = cb3.getState();
          if (fulltime)
            price = 1;
          if (parttime)
            price = 2;
          else
            price = 3;
          int mode =  Integer.parseInt(c[c1][price]);  
          System.out.println("total cost of your selection is: �" + courses_list.getCost(p1,mode));
    class Courses
    import java.util.*;
    public class Courses
    private String[][] Listing = new String[3][4]; //create array 3 rows * 4 columns
    Courses(String[][] c)
       this.Listing=c;
    int i;
    int j;
    int p;
    int price;
    int people;
    int cost;
    String t;
    String p1;
    String getTitle(int i)  //return Course Title
       t=Listing[0];
    return t;
    int getPrice(int i, int j) //return Price (Full-Time, Part-Time, Concessions)
    p1=Listing[i][j];
    p=Integer.parseInt(p1);
    return p;
    int getCost(int pe, int pp)
    pe=price;
    pp=people;
    cost=pe*pp;
    return cost;

  • System.out.println()'s inside implementation

    Hello,
    We all know the System.out.prinltn() API. But I want to know the inside implementation of System.out.println() API. Where can I get this implementation?
    Furthermore, can anyone explain concretely about how to implement System.out.println()? Can you tell me in a great detail?
    JohnWen604
    21-June-2005

    I just cannot understand what is the magic behind
    d that one API can control the hardware(i.e. control
    the screen to print one "simple" sentance). Do youIt's called "native OS methods". And you're not controlling anything, the graphics driver does. You're just asking the OS to ask the driver to ask the graphics card to send the appropriate signals.
    think that is just just the magic of our grand new
    computer? So If I can fully understand how the
    hardware is controlled by the Application Program, I
    will be more sensible in writing software. Just likeI doubt that. The more sensible way would be to stick to a useful level of abstraction and good design.
    you know the IC's inner structure if you want to be
    an qualified Electronic Engineer. Do
    you think so?No.
    Besides, from some OS books I know that
    w that Application program written in Java will
    become some OS commands that is ready for going
    through the OS's command processor. I just do not
    understand how that primitive Java code is written
    which is OS command and can tell hardware(screen) to
    print something. Do you know what that primitive Java
    code is?-- The primitive Java code that is a OS
    command to tell screen to print something. The
    primitive java code 's examples are "+", "for",
    "while", "private". The primitive java code does not
    mean API.No. It's called "instructions".
    What you said about setOut0(), I think
    setOut0() is simply an API. Do you know the
    implementation of this setout0() API? There must be
    implementation and there must be the primitive Java
    code. Do you agree with me?No. It's N-A-T-I-V-E. No Java code. Nowhere. Just C++ or whatever.

  • System.out.println does not print out anything

    I'm wonder why the dos mode does not print out the System.out.println.
    My code has:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class test extends HttpServlet {
       public void doGet(HttpServletRequest request,
       HttpServletResponse response) throws IOException,
       ServletException {
          System.out.println("Hello");
    The compilation is ok... but it does not display anything... how come?

    "System.out.print()" prints to the log file of the tomcat server. in order to print on the screen use JspWriter.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class test extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws IOException,
    ServletException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("Hello");
    //System.out.println("Hello");
    Hope this helps!

  • Is there a way to make system.out.println() scroll down as it goes?

    I am writing a program where I want to be able to read what's printed out in the console of my IDE through System.out.println() as the program runs/after the program runs. However, right now I run the program, the message prints out, and then when I go to read it the scroll bar is all the way up so I can see only the top of the print-out (the first thing printed out). Is there any way I can get the console to scroll along with the text, kind of like floating boxes you see on various websites for various reasons? In other words, can I get it so that when I look in the console at any given moment of the program running, I am looking at the newest text printed out (the text at the bottom of the "page")? Thank you!

    That would be an IDE problem and not a Java one. You could redirect output into a text file so you can read at your leisure and scroll up and down as much as you like.

  • Is there a way to force System.out.println to run when called

    I working on my first threaded program and having a hard time debugging. I've used System.out.println to let me know what's going on but due (I assume) to the nature of threads the output is not sequential. Is there a way to force println to execute immediatly so that they show up in the order they were called?
    Thanks --- Mike

    mjs1138 wrote:
    endasil, Thanks for the reply. I'm currenlty running the program from within the NetBeans IDE. It is the output displayed by in NetBeans "output" that I'm looking at.
    --- MikeI don't use Netbeans, but I would guess that it too pipes Standard Out and Standard Error to the same console. You didn't address my comment. Are you printing to System.err as well? This happens implicitly if you use Exception.printStackTrace(), for example.

  • 32-bit JDK 7 System.out.println not working in IDE

    Hi folks,
    I have a 64-bit Windows 7 OS.
    Due to 3rd party library/jar dependencies, i had to install the 32-bit Java JDK 1.7 and Eclipse IDE.
    I also installed NetBeans.
    So i have a 64-bit OS and am running 32-bit Java JDK/JRE & IDEs.
    The problem I am having is that my program's System.out.println("...") statements are not outputting strings to either IDE debug console.
    Executing the compiled program from a command line/prompt produces the expected string output.
    The basic "Hello, World" program is enough to cause this behaviour to start occurring.
    I have not manually / intentionally changed any IDE-specific Debug Console or Windows environment settings.
    One caveat: This same environment has worked successfully in the past ?! Yes, this is one of those "..it worked last week & yesterday and today it isn't and i swear i didn't do anything..." issue.
    Thoughts ?

    Thanks for the reply.
    The 64-bit versions of Java & Eclipse were installed first.
    When i discovered I had to use the 32-bit versions, i un-installed the 64-bit ones & installed the 32-bits.
    Even after that initial un-install 64-bit/install 32-bit process, it was working.
    I have also been installing the Windows 7 64-bit OS updates when i am informed of them.
    I'm not sure if any of these would affect how the Eclipse / NetBeans IDEs behave.
    Behaviour has been inconsistent.
    Initially it was always working.
    But over the past several days, it has been working less and less.
    I don't have any large data structures.
    This isn't a large complicated program, couple hundred lines, so i highly doubt that i'm doing anything to the resources, but something has changed.
    The main project I am working on takes command line parameters, does some initial processing, produces output using System.out.printlns [SOP] then depending on the parameters, branches into 2 different processing paths, let's call them A & B. Each of these processing paths also use SOPs. When i run the program in the IDE going thru path A, sometimes the initial SOP statements will work and the SOP statements specific to path A will also work. If i immediately change the parameters to go thru path B & re-run it, not even the initial SOP statements before the branching decision work.
    I've tried doing System.flush()s too - no affect.
    I haven't tried the re-direction option to a file option you mentioned yet.
    It always works from a command prompt - that is telling me that the Java SOPs are working properly, correct ?
    Inside an Eclipse or NetBeans IDE, SOP output to the debug console is inconsistent.
    Running from a command prompt, the SOPs always work.
    It'd help to know if this an IDE issue, a Java issue, a Windows 7 issue so i can narrow down where to try and correct the situation.
    I have a Windows XP VM set up, i'll try running the program there and see if there's a difference.
    Thanks for your reply.

  • How can i put a system.out.println into txt file

    i want to generate a txt file instead of system.out.println. for the output How can i do that and what code can i use for that??
    Edited by: crystalarun on Oct 14, 2007 11:40 AM

    suppose u ant output in "Output.txt"
    then code can be
    PrintStream out = new PrintStream(new FileOutputStream("Output.txt"));
    System.setOut(out)

  • System.out.println () is not working properly

    Hi, Why does this happens:
    Object temp=null;
    System.out.println ("temp is null? "+temp==null);
    just prints: true
    expected: temp is null? true
    Why does this happens????
    If I do System.out.println ("temp is null? "+(temp==null)); it works bu it should work without the pharentesis too

    MelGohan wrote:
    Hi, Why does this happens:
    Object temp=null;
    System.out.println ("temp is null? "+temp==null);
    just prints: trueThat is odd, mine prints "false".
    type Test126.java
    public class Test126 {
        public static void main(String[] args) {
            Object temp=null;
            System.out.println ("temp is null? "+temp);
            System.out.println ("temp is null? "+temp==null);
    }javac Test126.java
    java Test126
    temp is null? null
    false

  • System.out.println in Web Dynpro Java

    I call System.out.println in some components in web dynpro java.  But I cannot find the standard console output file of SAP J2EE Engine. Anyone know where is the location of standard output file?

    Thanks Deepak. Your link blog is working.
    Sreeni: I cannot find a start-up log file. Could you please tell me the real path?
    Edited by: Nuttakorn Boonthamtanarung on Apr 1, 2010 6:58 AM

  • System.out.println not working in Tomcat-4.1.x

    System.out.println not working in Tomcat-4.1.24. Any settings has to be enabled??? I am using tomcat for Solaris

    I think u can use ServletContext.log() to output info instased.

  • Where to see the System.out.println() messages

    I deploy my application in Oracle9ias . I have some System.out.println() statements in java class files.
    When I run the application I need to know where I can see those println() statements.

    The Member Feedback forum is for suggestions and feedback for OTN Developer Services. This forum is not monitored by Oracle support or product teams and so Oracle product and technology related questions will not be answered. We recommend that you post this thread to the Application Server-General forum. The URL is:
    Oracle Application Server - General

  • Where to see the System.out.println statements on soa server.

    Hi,
    I have generated some proxy classes in my jdeveloper. And I have deployed that project to the admin server on my soa_domain.
    Now my java files have some System.out.println statements. I want to see those values.
    Can anyone please let me know where I can see those statements on server.
    What s the file name where i can see.
    do i have to enable some debigging on the server. if yes then for what level i need to enable the log at what level.
    Thanks
    Anoop

    Hi,
    System.out.println is not really a good way to debug in weblogic... If you didn't configure where the stdout will go those messages can end up going nowhere...
    I suggest you use one of these...
    This will go to the soa*diagnostic logs... for example DOMAIN_HOME/servers/soa_server1/soa_server1-diagnostic.log...
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import oracle.fabric.logging.LogFormatter;
        private static final Logger soa_logger = Logger.getLogger("oracle.soa.Logger");
        static {
            LogFormatter.configFormatter(soa_logger);
            soa_logger.log(Level.INFO, message);
            soa_logger.log(Level.INFO, message, t);or
    This will go to the server logs... for example DOMAIN_HOME/servers/soa_server1/soa_server1.log...
    import weblogic.logging.NonCatalogLogger;
        private static NonCatalogLogger weblogic_logger = new NonCatalogLogger("SomeMeaningfulNameHere");
            weblogic_logger.notice(message);
            weblogic_logger.notice(message, t);Usually info and notice will go to the logs by default, you can try with higher levels (error,warning) as well or you can tweek the server debug level to use lower levels...
    Cheers,
    Vlad

Maybe you are looking for

  • Too much Gmail

    Trying to set up my  new iMac and all my email accounts. Mail pulled in every single one of the 27000+ messages in my Gmail account. I don't want them all on my Mac; that's why the cloud exists. I'm willing to re-configure, start again, do what needs

  • Loyalty Program - Redemption - points to credit note for billing

    Hello everybody, when using loyalty program the customer can collect loyalty points. When it comes to redemption these points can be used to "buy" certain products. Now I need to know, if these points can also be transformed to a credit note which is

  • Filtering CFL on Matrix

    Hi to all, How can i filter the System CFL which is in Matrix Column. I have filtered the System CFL in Form but unable to do in CFL of Matrix. What i am trying to do is Filtering The Project Code CFL in A/R Invoice Here is the code i have if (pVal.F

  • This problem appears while installing oracle 10g on enterprise linux

    Hi All, While installing oracle 10g on enterprise linux 5 this message apear: http://img134.imageshack.us/my.php?image=problemqy2.png More Info: Oracle 10g supports redhat 4 and Enterprise Linux is redhat 5 so I changed the redhat-release to 4 to cou

  • Touch Pad, mouse not working on lower 25% of screen

    Have not seen this question, yet.   When on a web page, my double tap/left click does not work on about the lower 25% of the page.  The scroll arows work, but cannot click or type on the page if in the lower portion of the page.  After scrolling up t