Write system call results to a text box

I am making a DOS system call that creates a file. Once this file is created it gives me a "packet created successfully" message that is written to the screen.
I am using Netbeans 5.5.1 and Swing. and I want this message to be output into a JtextArea. The system call works fine and the file is created, I just can't get the message to write to my text area.
Below is a sample of my code:
private void btn_importActionPerformed(java.awt.event.ActionEvent evt) {                                          
// TODO add your handling code here:
     String Rep = txt_Repname.getText();
     String Work = txt_Workdir2.getText();
     String VOB = txt_VOBtag.getText();
     String VOBstorage = txt_VOBName2.getText();
     String Replicapath = txt_Replicapath.getText();
     String command = ("cmd /c multitool mkreplica -import -npreserve -nc -vreplica " + Rep + " -work " + Work + " -tag \\" + VOB + " -vob " + VOBstorage + " " + Replicapath);
     StringBuffer sb = new StringBuffer();
     Process p = null;
     try {
            p = Runtime.getRuntime().exec(command);
        } catch (IOException ex) {
            ex.printStackTrace();
    Scanner s = new Scanner(p.getInputStream());
    while(s.hasNextLine()) {
        sb.append(s.nextLine()+"\n");
    String result = sb.toString();
    txt_Importresults.setText(result);
    }           

This works okay for me.
import java.io.IOException;
import java.util.Scanner;
public class Tester {
     public static void main(String[] args) throws IOException {
           StringBuffer sb = new StringBuffer();
          Process p = null;
          try {
                 p = Runtime.getRuntime().exec("HELP");
             } catch (IOException ex) {
                 ex.printStackTrace();
         Scanner s = new Scanner(p.getInputStream());
         while(s.hasNextLine()) {
             sb.append(s.nextLine());
             sb.append(System.getProperty("line.separator"));
         System.out.println(sb.toString());
}Have you read the Traps article on JavaWorld?
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • CVP Opsconsole: Patterns for RNA timeout on outbound SIP calls - Dialed Number (DN) text box does not take any input

    Hi there,
    I'm having problems modifying the 'Dialed Number (DN)' text box under 'Advanced Configuration->Patterns for RNA timeout on outbound SIP calls' of the SIP tab in the Cisco Unified Customer Voice Portal 8.5(1) opsconsole. In a nut shell, I need to change the RNA timeout but some reason when typing into the Dialed Number text box, the input is not taken. The reason I want to change this settings is because my ICM Rona is not working with CVP:
    https://supportforums.cisco.com/thread/2031366
    Thanks in advance for any help.
    Carlos A Trivino
    [email protected]

    Hello Dale,
    CVP doesn't allow you to exceed the RNA more than 60  Seconds. If you want to configure the timer for DN Patterns you should  do it via OPS console, It would update the sip.properties files in  correct way, the above way is incorrect.
    Regards,
    Senthil

  • UDF text box in bottom section

    Can I add an UDF to fit 260 characters (I tested system only can fit 254) text box in the bottom area for "Remark" use not same comments?  
    How to populate UDF in SO or PO for this UDF not in Row or Title area? 
    Besides UDF "Remark" will need another Text Box to fit 440 characters in the bottom area as well. This is user's request for their business.

    I added my text from GoTo>Opening and Closing Remarks that can fit enough characters.  Very useful.
    Edited by: Lily Chien on Feb 8, 2009 10:06 AM

  • Linking 2 text boxes with different results

    Hello
    I am trying to Link a drop down box with names, to a text field containing the relative identification of that person,
    Here is what I am trying to do.
    The drop down would have              and the result in the linked text box
    Richard                                                       123456
    Steve                                                            654321
    Jerry                                                                125874
    Fred                                                                  987542
    I have attached a screen shot with some graphics
    How can I do this please?
    Thanks in advance

    Thank you so very much I will give it a go I am totally new to theis program.
    Sorry for asking more but.
    If the Dropdown has the names and once they have selected the name using the dropdown, I would like the texbox called "Certificatenumber" to associate the name with the correct number, how do I link the boxes.
    Any chance of a couple of screen shots.
    Sorry I am so bad on this I just started with forms like the other day.
    Thank you for your time everyone.
    (Thank you MarkWalsh)

  • Search Results Are Highlighted Within The Text Box? How ? Access 2013

    Hi Every one ,
    Below I am describing some coding issue in VBA-MS Access I am facing right now , and I hope u guys could help me resolve the issues :
    DB : MS access 2013 - RichTextBox In A Form -
    Language : VBA
    Problem In short : struggling to highlighting user search word within the search result query ..
    What I want :
    Helping to fix the second code shown below , the one I used to highlight ( reformat ) the text who's bound to a a field that store memo data type . code
    My Result Search Query VBA COde ( Work perfectly )
    strWhereToSearch = IIf(.framSearchIn.Value = 1, "[quknotSubject]", "[quknotBody] ")
    strCondition = strWhereToSearch & " Like '* " & strTextSearch & " *' OR " & _
    strWhereToSearch & " Like '" & strTextSearch & " *' OR " & _
    strWhereToSearch & "Like '* " & strTextSearch & "'"
    strSql = " Select * from qryExtraTool_QuickNoteSubCatMainCat "
    strSql = strSql & " WHERE " & strCondition & " ORDER BY quknotDate"
    The code that i am struggling to make it work for me to highlight the search word inside the textbox called .txtQuickNoteBody :
    'Control Source for the text box to display matches.
    Const strcTagStart = "<font color=""""red"""">"
    Const strcTagEnd = "</font>"
    strControlSource = "=IIf(" & strField & " Is Null, Null, " & _
    "Replace(" & strField & ", """ & strSearchValue & """, """ & _
    strcTagStart & strSearchValue & strcTagEnd & """))
    .txtQuickNoteBody.ControlSource = strControlSource
    Thank u all in advance .

    Thank u so Bruce , I finally found an answer to my question.
    The solution u provided looks complete except that i am confused by the meaning of strField , may i didnt provide more details in my  post .
    The strField var i provided earlier was not meant to be placed in my code  , the correct one is shown below .However , the strField means according to me is the field against which the search operation should take place based on the ( search Term )
    the user provided . 
    Here is the code after applying the solution u suggested :
    'Information collected from the user      
     strWhereToSearch = IIf(.framSearchIn.Value = 1, "[quknotSubject]", "[quknotBody] ")       
    strCondition = strWhereToSearch & "  Like '* " & strTextSearch & " *' OR " & _
    strWhereToSearch & " Like '" & strTextSearch & " *' OR " & _ 
    strWhereToSearch & "Like '* " & strTextSearch & "'" 
    'Fill result search  Recordset      
    strSql = " Select  * from qryExtraTool_QuickNoteSubCatMainCat   "         
    strSql = strSql & " WHERE   " & strCondition & "  ORDER BY quknotDate"  
    'Control Source for the text box to display matches. ( Highlight the search word )     
    txtQuickNoteBody = SearchHilight(strWhereToSearch, strTextSearch)
    Tell me if my implementation to your code is right ?
    Thank u again Bruce ...

  • Displaying the result of a calculation in a dynamic text box

    Hi folks,
    I'm having a very minor issue here (operator error, I'm sure ). With the help of some folks here, I've created a series of calculations, and I've got that part down. Now, I just need it to show up in the movie.
    I've created the dynamic text box in Flash (CS3), but when I hit test, it won't show up.
    After all the calculations, I should have a figure that I call totalmoney. My dynamic text box is called total. The user doesn't need to hit anything for it to appear. It just appears as part of the movie.
    Here's my code:
    stop();
    var startDate:Date = new Date(2010,0,12);  // use your  startyear, startmonth, startdate in the new Date() parameters.
    var  currentDate:Date = new Date();  // assuming user's clock is correct and in your  timezone.  else use server date/time.
    var numberOfSeconds:Number =  (currentDate.getTime()-startDate.getTime())/1000;
    var interest:Number =  (numberOfSeconds*0.74356);
    var totalmoney:Number =  (interest+15,000,000);
    function displaytotal(evt:TextEvent):void {
         total.text = "totalmoney";
    Any thoughts?
    Thanks!
    Napo

    You didn't have to bury any of the calculations in the function--leaving it as you had it is better.  They could remain where they a=werew, and you'll probably find you want them outside it if you have other plans for using them.  If left inside, they only have scope inside.  In the programming world, it's good to think of functions as things that do one thing and one thing only (though it isn't often practiced that way)--it's called modular design.
    When you place an event as an argument for a function, it typically means that there is an event listener that initiates the call to the function.  If you work with buttons you'll see what I mean.  But if the plan is to create your own call to a function when you desire it as such, not have it driven by an event listener, then you don't need to pass any event to it, though you may pass some other type of variable to it if need be.
    For instance, what you have now will call the function without an argument because the function has the value built into its code....
    displaytotal();
    But you could also make the function a little more generic and set it up to recieve the value instead as an argument...
    function displaytotal(amt:Number):void {
         total.text = String(amt); // an earlier error of mine
    displaytotal(totalmoney);
    That would make your function a little more useful.  Now it could be used to display other Number variables as well.
    // my earlier error was that a textfield displays text, so you need to convert the Number value to s String.
    Hope I'm not confusing you.

  • I want to change the size and color of text in call out boxes and text boxes. How can I do this? Jack

    I want to change the size and color of text in call out boxes and text boxes. How can I do this? Jack

    Highlite the text inside the text box and then press Ctrl+E.

  • How do you change the font color in CALL-OUT text boxes in PRO XI?

    How do you change the font color in CALL-OUT text boxes in PRO XI?

    It's not so simple to find it if you don't know what you're looking for... But it can be found via View - Show/Hide - Toolbar Items - Properties Bar.

  • In InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to

    This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

  • Where is the text 'box' to be able to write in the text?

    Dumb sounding question, I know, but when I try to create a standard text ... the Inspector doesn't have a text box in which to write the text.  Something's fishy.  Just wondering what click I may have missed.
    Here is what I see in my Inspector ... where the text box is supposed to be, there is none.

    Hi Tom, fox_m,
    Thank you kindly.  Duh.  Never thought to do that.  And I've done it before too.  Will not forget this time.
    Mucho appreciated, had to get this off to the client tomorrow morning.
    Ben

  • Button to call pl/sql stored proc using text box value as parameter

    I need to create a portal page with an input text box and a button (or a clickable pl/sql item). A user will enter a value in the text box and click the button, a stored pl/sql procedure will be executed that takes the value of the text box as an input parameter. The procedure output (basically a success or an error message) must be printed in a new window which the user can close after checking the output. No redirection to another page is required.
    I have no experience in developing portal pages and would appreciate if you point me in a right direction. Do I need to create an html form and obtain the value of the text box via p_session object? In this case what do I need to specify as ACTION for the form - the same page URL? Where should I place the call to the stored procedure? Or can I somehow use a pl/sql item?
    Thank you for your help

    Hi Arnaud
    Thank you for the reply. Could you please give me dome more details. I have created a procedure:
    create or replace procedure grant_roles (p_username varchar2) as
    begin
    <code>
    htp.p('Grant succeeded for username is '||p_username);
    exceptions when others then
    htp.p('Grant failed. '||v_err_msg);
    end;
    and an html portlet:
    <html>
    <body>
    <form name="input" action="/pls/portal/pls/portal_public.grant_roles_test?p_username=anna" method="get">
    <input type="text" name="t_username" size="20">
    <br>
    <input type="submit" value="Grant">
    </form>
    </body>
    </html>
    Obviously this is not the right way to call my procedure as it does not work. And of course I want to pass the value of the t_username text box to the procedure not the string "anna". I am also not sure where a procedure prints its output. Is it possible to open a new window to display the output?
    Thank you for your help,
    Anna

  • System dialog? black text box in the screen?

    How do I close this program, it was opened by accident. it's a black text box that is telling me everything I type, point or click on....it's REALLY annoying!

    System Preferences -> Universal Access -> Seeing tab -> turn Voiceover off

  • Using Symbols in a Call-out Box or Text Box

    Our engineers need to type in special symbols like degree, plus minus, empty set, etc. into a Call-out Box, Text Box, etc. when they are marking up a technical drawing.  Is there an easy way to do this?  Thanks for your help.

    That's what I tried initially.  However, when I try that in the Call-Out, it doesn't work - it gives me an error tone and does not type anything.  I've used both the numberpad keys and the number keys along the top, if that makes a difference.  Let me know if you can get it to work in the Call-Out - I could be doine something wrong!

  • Why is there always the text of an old message in the text box every time I go to write a new message?

    For the last three days, when I go to write a new text/iMessage, there is the text of a message I sent recently in the text box. I've tried everything to get rid of it, but nothing seems to work... each time I go to write a new message, there's the same old text again. does anyone know why this is happening - and what I can do to erase it and get back to a good old blank text box? Thanks for your help!

    If the login box keeps popping up either your acct is disabled or you are mistyping your pw.  
    Go here and try out your pw and reset if necessary:
    http://appleid.apple.com/
    Click on Manage ID and go from there.

  • Can't select text boxes with Type Tool to write in on pages, only on Master Page

    I'm unable to use the Type Tool to select the tax boxes on a document page in Indesign CC. I can select it on the Master Page. I can write on the Master Page. If I apply the Master Page afterwards, the written text from the Master Page appear on the document page, just as it should. But whenever I try to select a column on a document page, all the Type Tool does is draw a new text box (which I can select and write in). What's up with that? I applied the Master multiple times. If I can write on a the Master Page, why not on the document page?

    Individual master frames can be overridden on a document page by holding down Cmd + Shift (Mac) or Ctrl + Shift (Windows) and clicking on them with the Selection tool.
    Empty master text frames are generally more useful for placing external text files and having them flow from page to page than for typing, and they need not be overridden to do that -- just move the loaded cursor inside the frame.

Maybe you are looking for

  • Firefox works at mcdonalds with windows but not with linux

    I have Windows 7 Pro and Ubuntu 14.04 LTS on my laptop. I use firefox browser on both OS's. I am able to connect to internet when I use Windows OS and run firefox at McDonalds. But, when I try to use firefox and Ubuntu OS it will not connect while at

  • Background image in a div?

    I know how to use css to place a background image inside a div. However, I would like that image to be contextual, and be differrent depending what the current page is. As an hypothetical example, I would like a non-repeating background image of an a

  • Missing lines in books

    Downloaded Nineteen Minutes by Jodi Picoult as the first book for my wife. It appears to be missing the last line, or several lines on the pages. I can use portrait or landscape mode but miss lines in either. Am I missing something?

  • Problem connecting to Oracle 8i (817) using Packaging Wizard of 9i Lite

    I am having a problem to connect to Oracle 8i database (817) from using Packaging Wizard. I am getting a error message when I tried to use Packaging Wizard -> Snapshot -> Import -> Username/password and jdbc:oracle:oci8:@connect string or jdbc:oracle

  • Maxl statement for substitution variable..

    Friends, Do we have a maxl command that will return substitution variables at the server level along with their values. This would help us do a quick check of the system at all environments using VLOOKUP before the cycle starts.. The manual check see