Java exec spawns command window

Hello,
I am using JRE 1.4.2 (Eclipse runtime environment). Whenever I execute the following command:
System.getRuntime().exec("<some command>");
I am getting a Command Window that pops up while the process executes and closes afterwords.
Is there any way to prevent this command window from appearing. I have chained all Error and Output streams within the java program but no luck. I guess the only other solution is to not make the exec calls by making native calls from the java program, but that would be a huge undertaking.
Thanks in advance.

Yes, I think you are correct.
When I do the same with say calc.exe or notepad.exe, I do not get this dos command prompt.
The command that I am trying to execute here is PCLI.exe (for PVCS). Do you have an idea of how I can deal with this program so that I do not get that annoying comand prompt?

Similar Messages

  • DOS Commands Used in Java Pgm, but command window should NOT be visible!

    Need a solution for the following.
    Problem: In a Java program, DOS Commands are used.
    Hence while executing it, the command window is visible for few seconds and later it is hided i.e once the processing of that DOS Command is finished.
    Solution Required: The Command Window should not be visible. The DOS Commands should be performed in the background with out making the command window visible.

    Problem:
    I am trying to run a executable file through java . But a command window always pops up. I want the command window not to pop up while the code is executed. Alternatively the rt.exec method should run in the background till the process is complete.
    I am using the following code in Java Swing application , where in when a user clicks a button the following method is invoked , which is turns invokes a windows a rasdial.exe file .Ex: rasdial MyConnection;
    Can someone help me on this. The below is a snippet of my code .
    public void callSerialOrInfraExe(String exeName) {
    executableFile = exeName;
    Runtime rt = null;
    Process process = null;
    boolean checkCon = false;
    try {
    rt = Runtime.getRuntime();
         process = rt.exec("rasdial " + executableFile);
    process.waitFor();
    checkCon = checkConEstablish();
    if (checkCon) {
    lblMsg.setVisible(true);
    cmdSubmit.setText("Done");
    cmdSubmit.setMnemonic('D');
    rdbSerialPort.setVisible(false);
    rdbInfraredPort.setVisible(false);
    jLabel1.setText(msgStr.toString());

  • Again...Suppressing the Java Command Window

    Hi,
    My invoking my java application with "javaw", I'm able to suppress the command window.
    None of the System.out.println() is now seen. Thanks for that.
    But there is another problem that I see.
    In my application, I run some batchfiles using the Runtime.exec
    with the "cmd" parameter. This is making a separate command window
    pop up from no where.
    This pop up is happening for every call I make ? Can this be avoided at all ???
    Or should I live with it ??
    Many Thanks

    You may have to live with that cause cmd runs with its own window. I haven't used this very much but for the little I have done, I can't ever seem to get it to hide, unless you decide to use START to run the activity and then call EXIT in the batch file so it closes as soon as it is done.
    ICE

  • Supressing the Java command window ???

    Hi,
    How do I get rid of the command window from where I start my Java Application ?
    Even if there is a way what will happen to all the System.out.println() calls in my applicatio ?
    Thanks in advance.

    You can just not start the Java application from a command window or batch file. The easiest way to do this is to create an executable JAR file which a person (on Windows) can just double-click. Do a search on "executable JAR".

  • Minimizing the java command window?

    I'm running a excutable jar file:
    'java -jar myExe.jar'
    i leave the command window open, and task manager window open next to it. when i minimize my command window, i see the CPU usage for the java process go down. why does it do that?

    Nobody has experienced this before?

  • Using java to run command line as %username%

    Hi all,
    can any one help with this?
    I'm trying to run a command line from a database as %username% in Windows. So far I have the following script, courtesy of Frank Naude to build a java class that is published within a plsql procedure. A command line can then be passed to it.
    rem -----------------------------------------------------------------------
    rem Filename: oscmd.sql
    rem Purpose: Execute operating system commands from PL/SQL
    rem Notes: Specify full paths to commands, for example,
    rem specify /usr/bin/ps instead of ps.
    rem Date: 09-Apr-2005
    rem Author: Frank Naude, Oracle FAQ
    rem -----------------------------------------------------------------------
    rem -----------------------------------------------------------------------
    rem Grant Java Access to user USER1
    rem -----------------------------------------------------------------------
    conn sys/password@database as sysdba
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.io.FilePermission', '/bin/sh', 'execute');
    EXEC dbms_java.grant_permission( 'USER1', 'SYS:java.io.FilePermission','C:\WINDOWS\system32\cmd.exe', 'execute' );
    rem -----------------------------------------------------------------------
    rem Create Java class to execute OS commands...
    rem -----------------------------------------------------------------------
    conn user1/password@database
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\WINDOWS\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    // Execute the command...
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    // Capture output from STDOUT...
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("stdout: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    } catch (IOException ioe) {
    System.out.println("Error printing process output.");
    ioe.printStackTrace();
    } finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    // Capture output from STDERR...
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("stderr: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    } catch (IOException ioe) {
    System.out.println("Error printing execution errors.");
    ioe.printStackTrace();
    } finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    show errors
    rem -----------------------------------------------------------------------
    rem Publish the Java call to PL/SQL...
    rem -----------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE host(p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    show errors
    rem -----------------------------------------------------------------------
    rem Let's test it
    rem -----------------------------------------------------------------------
    exec host('notepad');
    The trouble is although this script works great for commands that can be run is the 'background' as SYSTEM is I want to pass a command to actually open something e.g. notepad in the above example nothing seems to happen. As far as I can make out the command line is running but not as %username% so it's not running notepad.exe in the foreground.
    I'm happy to clarify more if necessary.
    Can anyone help with this?
    Cheers
    Yog

    Bill,
    Thank you for the quick answer. I believe you are right in your assumption.
    I have been searching but found nothing so far.
    I need to be able to run this line "wmic
    Product where name='XXX XXX XXX' call uninstall" 
    in an elevated command prompt to uninstall the program.
    I was looking for a VB script or PowerShell to execute it remotely on non domain roaming PCs.
    Th3e command can be run remotely against stand-alone workstations but you must supply credentials.  Post in the platform forum for you version of Windows for help in using the WMIC utility.  WMIC /? will give you all of the command options fro
    remote execution.  UAC only affects local systems.  You cannot use WMIC to remote back to the local system. WMIC does not allow impersonation to the local system.
    Most installers will not automatically allow an unattended uninstall.  If there is any dialog at all the uninstall will fail and can hang.
    I recommend contacting the vendor of the application to get more information.
    In all cases you cannot bypass UAC as Bill has noted.  I am only noting that, sometimes, in a workgroup, you can use WMIC to remotely uninstall an application.
    ¯\_(ツ)_/¯

  • Ant task poping up command window

    Is there any way to have ant stop poping up command windows for every 'java' execute task ?

    You can work around it by invoking JDeveloper using jdev.exe instead of jdevw.exe. You'll still have a command window, but only one, and it will stay permanently.
    This was a bug in java's Runtime.exec() functionality, and has been fixed in 1.4 (and consumed in JDeveloper 9.0.4).
    Brian
    JDev Team

  • Cannot run command window

    In Windows I would expect to call up a seperate command window with the following, but it appears to freeze up. What am I doing wrong?
    import java.io.*;
    public class command {    
      public static void main(String[]args) {
        try {
          Process runprogram = Runtime.getRuntime().exec("C:\\windows\\system32\\cmd.exe");
          try {
            runprogram.waitFor();
          catch(InterruptedException e){}
        catch(IOException e) {
          System.err.println("Cannot run command window");
    }

    What about this...
        Process proc = null;
        try
          proc = Runtime.getRuntime().exec("start cmd");
          proc.waitFor();
        catch(Exception e)
          e.printStackTrace();
        }Some dukies would be nice next time ;-)

  • Runtime + Command window

    Hi,
    I am trying to execute Runtime.getRuntime().exec() command on click of a button. It works fine, but the problem is that i get a command window when the command is executed. Is there any way to make the command window not to appear?

    Duplicat thread, answer here
    http://forum.java.sun.com/thread.jspa?messageID=4034633

  • Runtime exec opens new window

    Hi, I am using Runtime.exec to run an external application in Windows2000. � can read its output and i can destroy it without any problems.
    But when i run my java application with javaw , the external application i run with rt.exec opens new window(without output texts, empty) . just output command windows which opens when i run the external app. from a command prompt.
    If i run my java application with java.exe then then external application DO NOT open new window and run correctly. But this time my java window stays on desktop, and that's not any good for a Windows Application.
    In both cases everything runs OK. The only problem is the command prompt windows.
    Is there a solution when working with javaw.exe ? or hide the window when running with java.exe
    Thanks all.

    bug with ID: 4244515

  • Eliminating the Command window in Windows

    I had thought I had found a way to make the command window (the black command interpreter window in Windows that comes up when you run the JVM) go away. I used the following code:
    public class StartApp {
         public static void main( String[] args ) {
              String command = "java";
              for ( int n = 0; n < args.length; n++ )
                   command += " " + args[n];
              if ( args.length > 0 ) {
                   try {
                        Runtime.getRuntime( ).exec( command );
                        System.exit( 0 );
                   catch ( Exception e ) {
                        System.err.println( e );
                        System.exit( 1 );
              else
                   System.out.println( "Format: java StartApp [-options] <filename> [arguments]" );
              System.exit( 0 );
    When I run this Java app and put in another app for it to run, it runs that app just fine (it's a Swing app so I don't need the command window visible). Not only that, but it gives me the command line right after starting it (meaning the original app exited). So, theoretically, you would think I could just type "exit" to close the command window. Well, when I do type that, the command window waits until the program exits before actually closing. Manually closing the command window closes the whole program. The odd thing was, an older version (I think Java 1.1) of the JRE would allow the command window to close. But, with 1.3, it does not. Does anyone have any idea about how I could change this, or of another way to get rid of the command window?
    -Sam Fahmie

    Sorry, didn't put the code tag in right...
    public class StartApp {
         public static void main( String[] args ) {
              String command = "java";
              for ( int n = 0; n < args.length; n++ )
                   command += " " + args[n];
              if ( args.length > 0 ) {
                   try {
                        Runtime.getRuntime( ).exec( command );
                        System.exit( 0 );
                   catch ( Exception e ) {
                        System.err.println( e );
                        System.exit( 1 );
              else
                   System.out.println( "Format: java StartApp [-options] <filename> [arguments]" );
              System.exit( 0 );

  • Workflow 2.6.4.0.0 configuration problem - Command window does not close

    I am trying to install Oracle Workflow 2.6.4.0.0. as part of Warehouse builder using the details mentioned in this link
    http://www.oracle.com/technology/obe/10gr2_owb/owb10gr2_gs/owb/lesson4/etl-mappings.htm
    From the Start menu click Programs > Oracle <Database HOME> > Configuration and Migration Tools >
    Workflow Configuration Assistant. The Assistant is started.
    Accept the default for Install Option
    Workflow Account: (Accept the default ) owf_mgr
    Workflow Password: owf_mgr
    SYS Password : <Enter the SYS account password>
    TNS Connect Descriptor: localhost:1521:orcl
    Click Submit.
    However following this document, the command window did not close, and I did not get any message stating that Workflow Configuration has successfully completed.
    The command window displays this message as the final step and does not close-
    WorkflowCA: Executing :C:\oracle\product\10.2.0\db_1\jdk\bin\java -jar C:\oracle
    \product\10.2.0\db_1\oc4j\j2ee\home\admin.jar ormi://localhost:6041 admin welcome -application WFALSNRSVCApp -testDataSource -location jdbc/WorkflowDS -username OWF_MGR
    Is this installation complete? How to resolve this?
    Please can any one help?
    Thanks very much
    Allan

    I ran into this problem. And it took me while to get it fixed, but It does work.
    First the TNS Desc is misleading. One would think that it would be host:port:sid. What it is really looking for is host:port:servicename. But if you want to use the "Change Tablespace" drop down list you need to, enter the sys password, change it to host:port:sid - Then use the drop list. And change it back before you press submit.
    The second thing that I found is that it wants to use the SYSTEM tablespace as temporary tablespace. THis is becuase it is looking for a temp tablespace called TEMP. If you look a the line default_temp = SYSTEM. And if you dont supply a tablespace it wanted to change it in the wfsysgnt.sql script in the $OH\wf\sql directory. You would think that what ever the default database tbs and temp tbs is - that owf would use that. No, it wanted to change it. Oracle needs to fix this.
    So here is how i fixed it. I had to create a temporary tablespace called TEMP, does not need to be big as I dropped it after it was done. Then i had to modify the wfinstall.csh script and use the install options. Not the /tablespace this option is obayed but it will try to use the SYSTEM as the temp tbs. Here is my example that I appended:
    /wfacct "owf_mgr" /wfpasswd "my_owf_mgr_pwd" /debug "true" /tnsConnDesc "my_host_ip:my_port:my_servicename" /syspasswd "change_on_install" /tablespace "OWF_TBS"

  • How to get rid of the command window....

    How to get rid of the command window, automatically, once the .bat file which execute the .jar has been executed?
    Znx

    If you don't want the command window to show, use:
    javaw yourClass
    instead of...
    java yourClass

  • Output jframe information to command window

    Hi all I have a program that tracks the assets of a customer, kind of like a cart that holds cds, appliances, etc...
    I wanted to be able to print out the results to the command window after they enter the number of how many items from what the user enters after they press "current status" or if they "delete" their current items. I want it to keep doing this until they close the window and exit the program. People have told me to add the System.out.println to where it says "delete" or "current status" but Im not sure how to add it in I will attach the code here. Thanks
    import java.awt.Color;
    import java.awt.GridLayout;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class TestProgram extends JFrame implements ActionListener{
       JLabel column1, column2;
       JLabel totalItems, totalCost;
       JLabel serialNum;
       JLabel electronics, autos, furnitures, cds;
       JButton TrackAssets, delete;
       JPanel panel;
       JTextField electronicsAsset, autosAsset, furnituresAsset, cdsAsset;
       JTextField serialNumber;
       JTextArea items, cost;
       // constructor to initialize the top variables/fields
       public TestProgram()
             column1 = new JLabel("Select Items");
         column2 = new JLabel("Specify Quantity");
         electronics = new JLabel("Electronics");
         electronicsAsset = new JTextField();
         electronicsAsset.addActionListener(this);
         autos = new JLabel("Autos");
         autosAsset = new JTextField();
         autosAsset.addActionListener(this);
         furnitures = new JLabel("Furnitures");
         furnituresAsset = new JTextField();
         furnituresAsset.addActionListener(this);
         cds = new JLabel("Compact Discs");
         cdsAsset = new JTextField();
         cdsAsset.addActionListener(this);
         serialNum = new JLabel("Serial Number input here");
         serialNumber = new JTextField();
         electronicsAsset.setNextFocusableComponent(serialNumber);
    //Create labels and text area components
         totalItems = new JLabel("Total Items:");
         totalCost = new JLabel("Total Cost:");
         items = new JTextArea();
         cost = new JTextArea();
    //Create buttons and make action listeners
         TrackAssets = new JButton("Current Status");
         TrackAssets.addActionListener(this);
         delete = new JButton("Delete all");
         delete.addActionListener(this);
    //Create a panel for the components
         panel = new JPanel();
    //Set panel layout to 2-column grid
    //on a white
         panel.setLayout(new GridLayout(0,4));
         panel.setBackground(Color.white);
    // add details
         getContentPane().add(panel);
         panel.add(column1);
         panel.add(column2);
         panel.add(electronics);
         panel.add(electronicsAsset);
         panel.add(autos);
         panel.add(autosAsset);
          panel.add(furnitures);
          panel.add(furnituresAsset);
          panel.add(cds);
          panel.add(cdsAsset);
         panel.add(furnitures);
         panel.add(furnituresAsset);
         panel.add(totalItems);
         panel.add(items);
         panel.add(totalCost);
         panel.add(cost);
         panel.add(serialNum);
         panel.add(serialNumber);
         panel.add(delete);
         panel.add(TrackAssets);
       public void actionPerformed( ActionEvent event ){
                 // variables for method actionPerformed
                 String output, output2;
                 Object source = event.getSource();
                 Integer electronicsNo, autosNo, furnituresNo, cdsNo, serialNum;
                 // class responsible for showing different items
                 AssetTracker tracker = new AssetTracker();
                 Double cost;
                 // program is instance of TestProgram creates a new file
                 TestProgram program = new TestProgram();
                // if they track assets...
                if(source == TrackAssets){
                  tracker.serialNum = serialNumber.getText();
                  tracker.electronics = electronicsAsset.getText();
                  tracker.autos = autosAsset.getText();
                  tracker.furnitures = furnituresAsset.getText();
                  tracker.cds = cdsAsset.getText();
             if(tracker.electronics.length() > 0){
                       //statement that might throw an exception
                       try{
                           electronicsNo = Integer.valueOf(tracker.electronics);
                           tracker.itotal += electronicsNo.intValue();
                         //find invalid number     
                         catch(java.lang.NumberFormatException e){
                           electronicsAsset.setText("Invalid Value");
                       else {
                             tracker.itotal += 0;
             if(tracker.autos.length() > 0){
                        //find invalid again
                         try{
                      autosNo = Integer.valueOf(tracker.autos);
                      tracker.itotal += autosNo.intValue();
               catch(java.lang.NumberFormatException e){
                      System.out.println("Invalid Value");
             else {
          tracker.itotal += 0;
        if(tracker.furnitures.length() > 0){
           //seek invalid numbers
         //statement that might throw an exception.
          try{
            furnituresNo = Integer.valueOf(tracker. furnitures);
            tracker.itotal +=  furnituresNo.intValue();
        // statements to be executed if a matching Java exception occurs in try.
          catch(java.lang.NumberFormatException e){
             furnituresAsset.setText("Invalid Value");
             else {
          tracker.itotal += 0;
        if(tracker.cds.length() > 0){
         //check then find invalid
          try{
            cdsNo = Integer.valueOf(tracker.cds);
            tracker.itotal += cdsNo.intValue();
          catch(java.lang.NumberFormatException e){
            cdsAsset.setText("Invalid Value");
          else {
          tracker.itotal += 0;
        // display
         serialNum = new Integer(tracker.itotal);
         output = serialNum.toString();
         this.items.setText(output);
         tracker.icost = (tracker.itotal * 300.00);
         cost = new Double(tracker.icost);
         output2 = cost.toString();
         this.cost.setText(output2);
       // electronics, autos, furnitures, cds
       // if user delete all items from assets
       if(source == delete){
         serialNumber.setText("");
         electronicsAsset.setText("");
         autosAsset.setText("");
         furnituresAsset.setText("");
         cdsAsset.setText("");
         serialNumber.setText("");
         tracker.icost = 0;
         cost = new Double(tracker.icost);
         output2 = cost.toString();
         this.cost.setText(output2);
         tracker.itotal = 0;
         serialNum = new Integer(tracker.itotal);
         output = serialNum.toString();
         this.items.setText(output);
      // main method
      public static void main( String[] args )
            TestProgram frame = new TestProgram();
              // title of JFrame
              frame.setTitle("Asset tracking program");
            // mew window created
            WindowListener l = new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                            System.exit(0);// exit
            // add window from package then show window
            frame.addWindowListener(l);
            frame.pack();
            frame.setVisible(true);

    I don't understand the question. Are you telling us you don't understand how to use System.out.println(...);? How do you debug programs without using this method?
    Usually the first program someone learns to write is something like:
    public static void main(String[] args)
        System.out.println("Hello World");
    after they press "current status" or if they "delete" their current itemsYou want to do some activity when the above actions occur. You must already have code in your program to do something in the above cases. So simply add the System.out.println(..) statements in the same part of code.

  • Printing out to command window project

    hi all, i have a question on this cart program i am making, i wanted to know how to output the results to the command window every time a person clicks on the "current status" of their purchase. I want it to print out like ( 5 boxes purhcased, 4 cds bought, serial number is 1234...... ) i want it to do this until the person exits out of the program.
    i have pasted the code below thanks :)
    (copy and paste )
    import java.awt.Color;
    import java.awt.GridLayout;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class TestProgram extends JFrame implements ActionListener{
    JLabel column1, column2;
    JLabel totalItems, totalCost;
    JLabel serialNum;
    JLabel electronics, autos, furnitures, cds;
    JButton TrackAssets, delete;
    JPanel panel;
    JTextField electronicsAsset, autosAsset, furnituresAsset, cdsAsset;
    JTextField serialNumber;
    JTextArea items, cost;
    public TestProgram()
         column1 = new JLabel("Select Items");
    column2 = new JLabel("Specify Quantity");
    electronics = new JLabel("Electronics");
    electronicsAsset = new JTextField();
    electronicsAsset.addActionListener(this);
    autos = new JLabel("Autos");
    autosAsset = new JTextField();
    autosAsset.addActionListener(this);
    furnitures = new JLabel("Furnitures");
    furnituresAsset = new JTextField();
    furnituresAsset.addActionListener(this);
    cds = new JLabel("Compact Discs");
    cdsAsset = new JTextField();
    cdsAsset.addActionListener(this);
    serialNum = new JLabel("Serial Number input here");
    serialNumber = new JTextField();
    electronicsAsset.setNextFocusableComponent(serialNumber);
    totalItems = new JLabel("Total Items:");
    totalCost = new JLabel("Total Cost:");
    items = new JTextArea();
    cost = new JTextArea();
    TrackAssets = new JButton("Current Status");
    TrackAssets.addActionListener(this);
    delete = new JButton("Delete all");
    delete.addActionListener(this);
    panel = new JPanel();
    panel.setLayout(new GridLayout(0,4));
    panel.setBackground(Color.white);
    getContentPane().add(panel);
    panel.add(column1);
    panel.add(column2);
    panel.add(electronics);
    panel.add(electronicsAsset);
    panel.add(autos);
    panel.add(autosAsset);
         panel.add(furnitures);
         panel.add(furnituresAsset);
         panel.add(cds);
         panel.add(cdsAsset);
    panel.add(furnitures);
    panel.add(furnituresAsset);
    panel.add(totalItems);
    panel.add(items);
    panel.add(totalCost);
    panel.add(cost);
    panel.add(serialNum);
    panel.add(serialNumber);
    panel.add(delete);
    panel.add(TrackAssets);
    getContentPane().add(panel);
    panel.add(column1);
    panel.add(column2);
    panel.add(electronics);
    panel.add(electronicsAsset);
    panel.add(autos);
    panel.add(autosAsset);
         panel.add(furnitures);
         panel.add(furnituresAsset);
         panel.add(cds);
         panel.add(cdsAsset);
    panel.add(furnitures);
    panel.add(furnituresAsset);
    panel.add(totalItems);
    panel.add(items);
    panel.add(totalCost);
    panel.add(cost);
    panel.add(serialNum);
    panel.add(serialNumber);
    panel.add(delete);
    panel.add(TrackAssets);
    if(tracker.electronics.length() > 0){
                   try{
                   electronicsNo = Integer.valueOf(tracker.electronics);
                   tracker.itotal += electronicsNo.intValue();
                   catch(java.lang.NumberFormatException e){
                   electronicsAsset.setText("Invalid Value");
                   else {
                        tracker.itotal += 0;
    if(tracker.autos.length() > 0){
    try{
    autosNo = Integer.valueOf(tracker.autos);
    tracker.itotal += autosNo.intValue();
    catch(java.lang.NumberFormatException e){
    autosAsset.setText("Invalid Value");
         else {
    tracker.itotal += 0;
    if(tracker.furnitures.length() > 0){
    try{
    furnituresNo = Integer.valueOf(tracker. furnitures);
    tracker.itotal += furnituresNo.intValue();
    }catch(java.lang.NumberFormatException e){
    furnituresAsset.setText("Invalid Value");
         else {
    tracker.itotal += 0;
    if(tracker.cds.length() > 0){
    try{
    cdsNo = Integer.valueOf(tracker.cds);
    tracker.itotal += cdsNo.intValue();
    catch(java.lang.NumberFormatException e){
    cdsAsset.setText("Invalid Value");
    else {
    tracker.itotal += 0;
    serialNum = new Integer(tracker.itotal);
    output = serialNum.toString();
    this.items.setText(output);
    tracker.icost = (tracker.itotal * 300.00);
    cost = new Double(tracker.icost);
    output2 = cost.toString();
    this.cost.setText(output2);
    if(source == delete){
    serialNumber.setText("");
    electronicsAsset.setText("");
    autosAsset.setText("");
    furnituresAsset.setText("");
    cdsAsset.setText("");
    serialNumber.setText("");
    tracker.icost = 0;
    cost = new Double(tracker.icost);
    output2 = cost.toString();
    this.cost.setText(output2);
    tracker.itotal = 0;
    serialNum = new Integer(tracker.itotal);
    output = serialNum.toString();
    this.items.setText(output);
    public static void main( String[] args )
    TestProgram frame = new TestProgram();
              frame.setTitle("Asset tracking program");
    WindowListener l = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.addWindowListener(l);
    frame.pack();
    frame.setVisible(true);

    If you want to print out to the commmend line all you need to do if put in
    System.out.println(....whatever......);Add this line of code to whereever you click the button to display the users "current Status". In hte brackets is whre you put the details of what you want ot print out e.g. boxes purchaesd etc.
    Chris

Maybe you are looking for

  • I pod library does not match i tunes library

    I have a ipod classic. My pc was repaired and I did not back up my entire music library. I have those items purchased but nothing else. My pc was repaired and all my music was erased but I still have the files on the ipod. I would like to transfer FR

  • Playback in the Background

    I really want to be able to multitask while listening to the audio tracks of final cut video sequences, but when I change apps, final cut stops playing. Is there any way to change this setting?

  • Installation Directory of OBIEE in linux

    Hi all, I am trying to install OBIEE on Linux server, by default the installtion directory will be /usr/local/OracleBI /usr/local/OracleBIData Is that mandatory to install OBIEE under these directories or can i Install in any other directories like a

  • How can I improve the sound quality of my new iPod?

    Hey there, I just received my new iPod with my new MacBook Pro computer. I have read every bit of documentation i received plus I have scoured resources here on the forum, but I am baffled. I just synced my iPod for the first time to my Macbook, iTun

  • Breaking up of Budget into quarters and displaying in Bex

    hi All. I am new to SAP BW. Trying to create some queries. In my BW System we have a keyFigure called Budget and now the requirement is to Break it up into Respective quarters and display it. we have time characteristics as 1.Fiscal Year 2.Fiscal Yea