Results 1 to 6 of 6
  1. #1
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default javaw.exe problem in Task Manager

    Hello ....


    I have built a Java Program that basically uses a JFrame and Jpanels on top of that....

    When I run the main class file... All works fine....

    I ran that application several times to check different things... After some time my PC began to slow down too much....

    When I checked the "processes" under the Windows Task Manager...
    There was a file javaw.exe in the processes of my Task Manager.... And this file/process does not remove as soon as I close the application.... Instaed I have to End the process from the task manager....


    Does any one have an idea... why is that process there and how to end this process as soon as I close my application.... ??

    Many Thanks for the cooperation....

    Best Regards,
    Sarwar

  2. #2
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    Ah... One important thing...

    Also a new process javaw.exe is created each time I run the application....

    So as many time I run the application... I get more and more javaw.exe processes in the task manager....

    Any idea...

    Thanks

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,001
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by sarwar1234 View Post
    Ah... One important thing...

    Also a new process javaw.exe is created each time I run the application....

    So as many time I run the application... I get more and more javaw.exe processes in the task manager....
    Can you show us how you exit the application? There should be a bit of code in your JFrame handling class (hint: see EXIT_ON_CLOSE).

    kind regards,

    Jos

  4. #4
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    Hello....


    This is my main class with main method.... that executes the JFrame....

    Java Code:
    import javax.swing.JFrame;
    import javax.swing.UIManager;
    
    import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
    
    
    public class WindSpeedAnalysis {
    	
    	/**
    	* @param args
    	*/
    	public static void main(String[] args) {
    	// Auto-generated method stub
    
    	try {
    	UIManager.setLookAndFeel(new WindowsLookAndFeel());
    	}catch (Exception e) {
    	}
    
    	JFrame f = new JFrame("Wind Speed Analysis");
    	f.setSize(800, 600);
    
    	MainPanel mainPanel = new MainPanel();
    
    	f.add(mainPanel);
    
    	f.setVisible(true);
    
    
    	}
    
    }
    Do I need to do some thing with the JFrame to end the process javaw.exe ??

    Many Thanks......

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,001
    Blog Entries
    7
    Rep Power
    20

    Default

    Read all about it in the API documentation of the setDefaultCloseOperation() method in the JFrame class.

    kind regards,

    Jos

  6. #6
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    Hello...

    I just added this line at the end.. and it works :)


    Java Code:
    	f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


    Thanks very much for the help.....

    Best Regards...

Similar Threads

  1. task
    By boys21 in forum Advanced Java
    Replies: 6
    Last Post: 05-28-2010, 01:59 PM
  2. Help with a task.
    By checho in forum New To Java
    Replies: 5
    Last Post: 01-14-2010, 11:29 AM
  3. getting running application from task manager
    By gayathri_g in forum Threads and Synchronization
    Replies: 3
    Last Post: 09-26-2009, 06:43 PM
  4. " javaw " not recognized
    By ChosenOne in forum New To Java
    Replies: 1
    Last Post: 09-23-2009, 12:57 PM
  5. javaw.exe running jbroker.exe?????
    By fxRichard in forum Advanced Java
    Replies: 3
    Last Post: 05-11-2009, 11:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •