Standard output in jtextarea

Hi Guys!
I have a library that print some information with System.out.print(). I want to put that information in a jtextArea. Is it possible?? What is the way???
Thanks in advance!
Denis
Edited by: MrDeVito on Aug 26, 2008 3:23 AM

I have resolved my problem in this way.
I put this in the code
      protected OutputStream out = new OutputStream(){
         public void write(int b){
           jTextAreaDetails.append(""+(char)b);
           jTextAreaDetails.setCaretPosition(jTextAreaDetails.getText().length());
         } };after in the first class i put this: System.setOut(new PrintStream(out));
System.setErr(new PrintStream(out));After this simplify solution, when I use system.out.print() , all information are printed into the textarea.
Thanks
Denis

Similar Messages

  • Reading native process standard output stream with ProcessBuilder

    Hi,
    I'd like to launch an native process (windows application) which writes on standard output during its running.
    I'd like to view my application output on a JTextArea on my Java frame (Swing). But I do get all process output
    on text area only when the process is finished (it takes about 20 seconds to complete). My external process is
    launched by using a ProcessBuilder object.
    Here is my code snippet with overridden doInBackground() and process() methods of ProcessBuilder class:
    @Override
    public String doInBackground() {
    jbUpgrade.setEnabled(false);
    ProcessBuilder pb = new ProcessBuilder();
    paramFileName = jtfParameter.getText();
    command = "upgrade";
    try {
    if (!(paramFileName.equals(""))) {
    pb.command(command, jtfRBF.getText(), jtfBaseAddress.getText(), "-param", paramFileName);
    } else {
    pb.command(command, jtfRBF.getText(), jtfBaseAddress.getText());
    pb.directory(new File("."));
    pb.redirectErrorStream(false);
    p = pb.start();
    try {
    InputStream is = p.getInputStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line;
    jtaOutput.setText("");
    while ((line = br.readLine()) != null) {
    publish(line);
    } catch (IOException ex) {
    Logger.getLogger(CVUpgradeFrame.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
    Logger.getLogger(CVUpgradeFrame.class.getName()).log(Level.SEVERE, null, ex);
    jtaOutput.setText("");
    jtaOutput.setLineWrap(true);
    jtaOutput.append("Cannot execute requested commmad:\n" + pb.command());
    jtaOutput.append("\n");
    jtaOutput.setLineWrap(false);
    return "done";
    @Override
    protected void process(List<String> line) {
    jtaOutput.setLineWrap(true);
    Iterator<String> it = line.iterator();
    while (it.hasNext()) {
    jtaOutput.append(it.next() + newline);
    jtaOutput.repaint();
    //Make sure the new text is visible, even if there
    //was a selection in the text area.
    jtaOutput.setCaretPosition(jtaOutput.getDocument().getLength());
    How can I get my process output stream updated while it is running and not only when finished?
    Thanks,
    jluke

    1) Read the 4 sections of http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html and implement the recommendations. Although it is concerned with Runtime.exec() the recommendations still apply to Process generated by ProcessBuilder.
    2) Read about concurrency in Swing - http://java.sun.com/docs/books/tutorial/uiswing/concurrency/ .
    3) Use SwingUtilities.invokeLater() to update your GUI.

  • How to redirect standard output/error of a ucb function to matrixx command window

    Is there a way to redirect standard output/error of a ucb function to matrixx command window?
    I know that the recommended way is to use stdwrt or XmathDisplay commands. However, we have some
    libraries that already exists which uses printf calls and I would like to redirect their output
    to the matrixx command window.
    Thanks

    Hi,
    What you need to do is create a printf function that will print the information into a string, then you can use stdwrt to display it in Xmath.
    Then you tell the UCB linking process to compile and link with this version of printf.c
    I am including the printf.c that we used to test the function you needed.
    Hope this helps.
    Attachments:
    printf.c ‏1 KB

  • Capture standard output of another command-line program, with characters not in current codepage

    I'm using ProcessStartInfo.RedirectStandardOutput and Process.BeginOutputReadLine to capture the standard output of another program (specifically,
    youtube-dl.exe) and save them into a string variable.
    However the result variable contains only usual characters of my language such as traditional Chinese and English letters; characters such as Korean or Latin letters with accents simply vanished.
    I File.WriteAllText-ed the result variable and checked the file using serveral text editors, so I'm sure they're lost, not that they exist and merely be un-display-able by console window.
    Plainly executing youtube-dl in Windows Command Prompt displays complete messages including these foreign characters.  
    My youtubeDL_process.OutputDataReceived is simply:
    (s, e) => { if(!string.IsNullOrWhiteSpace(e.Data)) this._filename = e.Data; }
    How to make the redirected standard output string with foreign characters complete, just like one directly generated in a command prompt?

    Try a different experiment of starting your second EXE:
    string exe =
    @"path to your EXE with arguments . . .";
    Process p =
    new
    Process
    StartInfo =
    UseShellExecute = false,
    RedirectStandardOutput = true,
    StandardOutputEncoding = Encoding.UTF8,
    FileName = "cmd.exe",
    Arguments = "/C chcp 65001 > null && " + exe
    p.Start();
    string output = p.StandardOutput.ReadToEnd();
    p.WaitForExit();
    Specify the full path in the exe variable, using quotation marks if it contains spaces.
    Then check the value of output.

  • How to find Standard Output forms

    Hi,
    How to find the standard output forms for the following:
    1. Purchase Requesition
    2. RFQ
    3. Inventory Records
    4. Goods Receipt Note
    I want to access these outputs and add the company logo.
    Thanks in advance.
    Regards,
    Sriram

    Hi,
       Go to Nace Transaction code and then in the Left you will find Application and Description and there select ME for inventory and then click on output types.There select an output type in the list of output types given and then click the Processing Routines where you will get the complete details. For RFQ and Purchase Requisition check the Application EA.
      Coming to the uploading of the Logo. Go to Tcode se78 there below Form Graphics select Graphics and inside that you will find Bit map images . Select that one and click on import button which is present left to the delete button and there in the file name give the logo which is stored on your desktop and then select the type as Black and white or Colour Image as per your requirement.In the name give a meaningful for the logo in SAP system.Then click enter.
    Hope this will help you.
    Regards,
    Venkat.

  • How to remove actual XML content from Weather Web Service Client's standard output?

    Hi,
    I tried web service example examples.webservices.rpc.weatherEJB.Weather with WLS6.1,
    it works fine, but on client side, ( either Client or DClient ), I always see
    the actual XML content being sent and received from standard output, like
    "------------- RECEIVING XML -------------", and I can't find any related System.out.println
    statement in client source code, Please explain how to remove it, may there is
    a configurable parameter for this? any help will be highly appreciated.
    Thanks
    Naichen

    Hi Naichen,
    To suppress showing the actual SOAP request and response going to standard out,
    change the following line in the Client.java:
    h.put("weblogic.soap.verbose", "true" );
    to read:
    h.put("weblogic.soap.verbose", "false" );
    Regards,
    Mike Wooten
    "Naichen Liu" <[email protected]> wrote:
    >
    Hi,
    I tried web service example examples.webservices.rpc.weatherEJB.Weather
    with WLS6.1,
    it works fine, but on client side, ( either Client or DClient ), I always
    see
    the actual XML content being sent and received from standard output,
    like
    "------------- RECEIVING XML -------------", and I can't find any related
    System.out.println
    statement in client source code, Please explain how to remove it, may
    there is
    a configurable parameter for this? any help will be highly appreciated.
    Thanks
    Naichen

  • Name of the table for Standard Output/Cost maintained in in the IO

    Dear All,
    We go to KO03, enter the order no, display the order. Go to extras, Cost analysis. There are two columns. Total target cost and total actual cost. I need to find out the name of the table where the target cost/standard output is stored.
    Thanks in advance,
    Thanks,
    Satya

    Hi,
    The tables are :
    COSP
    COSS
    COSL
    COSB
    Regards,
    Eli

  • Changing standard output from Text to XML customization?

    Hi Team,
    We wanted to get an excel output for a standard reports Accounts Payables Trial Balance, we changed the output from Text to XML. We did not attach a data definition or template definition ..we just wanted to see the XML output.. We got an error in the process ."Caused by: oracle.xdo.parser.v2.XMLParseException: '=' missing in attribute" .. for which we raised a TAR..
    We were told in the TAR that changing the standard output from Text to XML is customization!!!!... can you please clarify if this is the case..

    Hi
    Is this issue get resolved ???
    Thanks
    Shivdeep Singh

  • Standard output type for Delivery picking list

    Hi All,
    My requirement is to trigger a picking list from the outbound delivery whenever the overall WM status is "B". Probably I need to look at a new requirement routine to add this condition.
    Pls tell me what is the standard output type available for delivery picking list. I have analyed "EK00". Looks like this works only for deliveries without warehouse management.
    Also we dont have a customization path for "EK00" and it has to be assigned to a shipping point.
    Pls confirm if we can use EK00 for deliveries with warehouse management and is it correct?Else what is the other standard output type available for delivery picking list.

    check ZPCK picking list.
    SPRO>Logistics Execution>Shipping>Basic Shipping Functions>Output Control-->Define print parameters shipping
    Here available ZPCK condition type.I think this condition record you can use.

  • Standard output in Web Logic

    Can anyone pls tell me where do all "system.out.println"s go in Web Logic server. I can get to see if it hits any exception, but it doesn't print the standard output there.
    I checked the Web Logic docs and it says that if I do not use Node manager to start the server, I won't be able to view the stdoutputs in admin console. I'm starting the server thru command-line so can not view them in admin console. Any idea about the location of the logfile where these messages go? I can directly open that file to view it in that case.
    thanks

    Srini,
    yes, I checked that before. I get all exceptions printed in that log-file but no "System.out.println"s.
    Another way of viewing the same file thru Admin console is by right-clicking on Order-server in left-panel, then clicking "view server log".
    thanks

  • Standard output when calling a method from a jar

    I have a question about obtaining standard output from a call to a method in a jar. I understand that a) and b) below are equivalent, but how do I get the output that the java call produces when I call SugarMain.decode in a java program? In other words, where does the output from SugarMain.decode go and is that equivalent to the standard output from the java SugarMain -decode call? I obtained the jar from http://bach.istc.kobe-u.ac.jp/sugar/ which has no user support.
    Thank you,
    Richard Becraft
    a) SugarMain.decode("sugar5400.out", "sugar5400.map");
    b) java SugarMain -decode sugar5400.out sugar5400.map
    java SugarMain -decode sugar5400.out sugar5400.map
    s SATISFIABLE
    a creditHours 10
    a id11672 true
    a id11673 false
    a id11674 false
    a id11675 false
    a id11676 false
    a id12385 false
    a id13043 false
    a id13044 false
    a id14032 false
    a id13046 true
    a id11852 true
    a id11921 false
    a id12832 false
    a id12833 false
    a id13355 false
    a id14311 false
    a

    Without knowing anything about SugarMain it is difficult to answer your question.
    It may help to know that there is nothing inherently different about classes referenced from jar files then classes referenced from loose class files. The specifies on how to get the output of SugarMain.decode() is dependent on SugarMain.decode().
    You say that there is no user support but is there any documentation or source files or samples. If the answer is "No" to all of those, it may be that you lose.

  • Using Standard output determination to advise PO changes in SRM

    Hello experts,
    Please advise if it is possible to use standard output determination to trigger IDOC creation on changes in PO's in SRM. I know this is standard functionality in ECC but not sure if this can be implemented in SRM.
    thank you

    No Replies.

  • To Transfer Data from Ztable using standard output ( FAX ).

    Is it possible to send data stored in Ztable to standard output device like FAX .
    Infact in a standard program we are using badi which in turn stores data in a ztable and i want to output data stored in this ztable using standard optput device ( fax) .
    If possible please guide on the procedure.
    Message was edited by: vidya bhushan
            Vidya Bhushan

    Hi Ravi,
    Thanks for you help.
    Ravi can you guide me on how to get the layout of the fax. Here fax is at client site so i am unable to get the fax sent. So if i configure dummy fax then can i see the fax layout . probably if possible you can send me the code where you called the function module SO_NEW_DOCUMENT_SEND_API1.

  • How to save standard output when WL is run as a service?

    We want to save the weblogic (6.1) server standard output and errors to
    a file. When Weblogic is run from the 'startWeblogic.cmd' file this can
    be done by appending '>>outfile.log' at the end of the command line,
    i.e.
    java ..... weblogic.server >>outfile.log
    However, when this is done in the service command line the service does
    not start up properly. How to do set this up properly?
    Thanks for any help you can give me.
    Regards,
    Joop Kaashoek

    There currently is no way to do this. We will review this as a possible
    future enhancement. If you're interested in looking at output to determine
    why the service is failing to start, you can enter the following (assuming
    in this case your service name is myserver):
    beasvc -debug myserver
    This should give you the information you need in this case.
    Joop Kaashoek wrote:
    We want to save the weblogic (6.1) server standard output and errors to
    a file. When Weblogic is run from the 'startWeblogic.cmd' file this can
    be done by appending '>>outfile.log' at the end of the command line,
    i.e.
    java ..... weblogic.server >>outfile.log
    However, when this is done in the service command line the service does
    not start up properly. How to do set this up properly?
    Thanks for any help you can give me.
    Regards,
    Joop Kaashoek

  • PWM on standard output

    Hi All
    I am using a NI USB-6211, and I have already used the two counters to do PWM in my project. I have a need to do one more that does not need tight control.  Does anyone have code to use a standard output, not a counter, for PWM control?
    Thanks
    Bob
    Solved!
    Go to Solution.

    In that case, the closest you could get is to toggle a digital output line with software-timed delays.  It's far from ideal, but I guess depending on what exactly you mean by "does not need tight control", maybe it would be good enough for your application?  I'd be pretty nervous about using this to control anything important though... software timing on Windows isn't terribly consistent (and the added bus latency of USB isn't doing you any favors either).
    Best Regards,
    John Passiak

Maybe you are looking for

  • What's going on with my iPhone 4?

    I have a very cracked screen.. completely shattered. NO PROBLEM THERE. Ran smoothly with a screen protector. No issues other than ugly broken glass. And it has seen some BAD days, but survived everything only an iPhone could endure. It recently fell

  • New apple tv shows message 'iTunes unavailable try later'

    Haven't been able to complete set-up, home share or anything. Any entry of iTunes ID and password brings up same message.

  • Window: Arrange: Tile - Breaks open sequence of files

    In CS3 this worked perfectly. CS4 it was broken with no workaround. In CS5 it's partially fixed but still not working. I work on animated sequences and use the Window, Arrange, Tile to display all the files at once. To open files in PS and keep the f

  • 0RecordMode, ODS and Generic Data

    I have created a Generic Datasource in R3 from a Y table. I will not be doing a generic delta on it. I replicated the datasource to BW and activated the necessary Transfer & Communication Structure. Now i want to store all the data in an ODS, but whe

  • Why is the last script executed twice?

    Here is my problem. I have two files, file1.sql and file2.sql that are called in a third file test.sql. The output from test.sql show that file2.sql was called twice --file1.sql select 'file1' as str from dual; --file2.sql select 'file2' as str from