Results 1 to 11 of 11
  1. #1
    dex3000 is offline Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0

    Default starting java from cmd froze on click event

    I'm starting java from command prompt windows 7 64bit. jre7
    First Jframe widow is ok, than I click on button and than secound window opens with Jtable which is populated from oracle db. This work ok.
    But than on second window I click button which should open third window (Jframe) with some textboxes to insert new data, but that doesn't happend rather when I click that button everything freezes and button looks (visualy) like it is pressed but isn't released.
    In eclipse everything runs fine. I can't figure out reason why is problem when starting from command prompt
    Please help it is urgent because it is for job interview

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: starting java from cmd froze on click event

    With no code we can only guess, but I suspect you are doing stuff on the button click event on the EDT (the "Swing Thread") that should be in its own thread, and whatever it is is hanging.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    dex3000 is offline Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0

    Default Re: starting java from cmd froze on click event

    is this a problem than , this is event handler of frozen button

    Java Code:
    btnInsert.addActionListener(new ActionListener() {
    			public void actionPerformed(ActionEvent arg0) {
    				
    				Component component = (Component) arg0.getSource();                
    				tableWindow window = (tableWindow) SwingUtilities.getRoot(component);
    				switch(window.windowType)
    				{
    				case "Orders":
    					insertOrder();
    					break;
    				case "Buyers":
    					insertBuyer();
    					break;
    				case "Cars":
    					insertCar();
    					break;
    				case "Staff":
    					insertStaff();
    					break;
    					default:
    						break;
    						
    				}
    				
    			}
    		});
    Last edited by dex3000; 09-06-2012 at 04:29 PM.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: starting java from cmd froze on click event

    Please use [code] tags [/code] when posting code.
    No idea on that code as whatever is causing the problem is likely in one (or all) of those methods.

    I would recommend sticking some debug code around liberally to see where it gets to.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    dex3000 is offline Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0

    Default Re: starting java from cmd froze on click event

    Quote Originally Posted by Tolls View Post
    Please use [code] tags [/code] when posting code.
    No idea on that code as whatever is causing the problem is likely in one (or all) of those methods.

    I would recommend sticking some debug code around liberally to see where it gets to.


    here is the message. what is it about?
    Invalid property category path: ValidationPropertiesPage (bundle: org.eclipse.wst.xml.ui, propertyPage: org.eclipse.wst.xml.ui.propertyPage.project.valida tion)

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: starting java from cmd froze on click event

    What message?
    Where did that come from?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    dex3000 is offline Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0

    Default Re: starting java from cmd froze on click event

    Quote Originally Posted by Tolls View Post
    What message?
    Where did that come from?
    Workspace Log in eclipse (Warning category)

    but i started program from command prompt java -jar . But seems eclipse tracks java everywhere

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: starting java from cmd froze on click event

    I doubt that is anything to do with your execution of that code from the command line.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    dex3000 is offline Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0

    Default Re: starting java from cmd froze on click event

    I think it does couse time of warining in logs are exactly when program freezes and only than and everytime same message

  10. #10
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: starting java from cmd froze on click event

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: starting java from cmd froze on click event

    Unless you have eclipse code in your application or you are (possibly) using eclipse's JRE then there is no way Eclipse will know that you are executing code from the command line.

    So, going back to my post #4, stick a load of debug code in there to find out what's going on.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. How to Open .odf(calc) File using java on Click event of button
    By deshmukh.niraj04 in forum New To Java
    Replies: 14
    Last Post: 03-15-2011, 08:31 AM
  2. Click out event
    By rulych in forum AWT / Swing
    Replies: 3
    Last Post: 02-17-2011, 04:43 PM
  3. Double click event
    By Dipke in forum New To Java
    Replies: 3
    Last Post: 10-22-2010, 11:39 AM
  4. click event
    By raman_v in forum Java Servlet
    Replies: 2
    Last Post: 01-08-2010, 12:05 PM
  5. How to perform some event to button click
    By eva in forum AWT / Swing
    Replies: 2
    Last Post: 01-16-2008, 12:27 AM

Posting Permissions

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