File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Need help understanding why my actionlistener is causing my program to freeze Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need help understanding why my actionlistener is causing my program to freeze" Watch "Need help understanding why my actionlistener is causing my program to freeze" New topic
Author

Need help understanding why my actionlistener is causing my program to freeze

Sebastion Hill
Ranch Hand

Joined: Jul 10, 2009
Posts: 48
I have a few inner classes in my main class and within one of those inner classes I have two more inner classes (for my actionlistener classes). Within one of those actionlistener classes I am creating an instance of a higher level inner class. Is this causing my program to freeze?

The deleteButton actionlistener works great UNTIL I call the editButton actionlistener. Once I have called the editButton listener my program no longer responds to the original button actionlistener or the deleteButton actionlistener.

I am wondering if that instance of the higher inner class is causing this??? I am also curious as to whether or not a call to an actionlistener stays open after the code within the actionlistener has been implemented.

Please help :-(


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Please help :-(

good luck, but most here won't read through 300+ lines of code (would you?).

you have to post something (small) that we can copy/paste/compile/run and see the problem on the screen.

doesn't matter how it looks, so get rid of the gridbaglayout stuff
any components not part of the problem - get rid of them
any listeners not part of the problem - get rid of them

all that is required is the bare minimum components/listeners to create the problem
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Your current code doesn't compile for us and has a lot of extraneous code that is unrelated to your question. If you don't get a helpful answer soon, you'll likely increase your chances of help by creating a small compilable program that we can run and demonstrates your problem. People here will likely be grateful to you for limiting the code that they have to read through when trying to help you. Best of luck!

Edit: what Michael said above!
Sebastion Hill
Ranch Hand

Joined: Jul 10, 2009
Posts: 48
thanks for the suggestion. I'll work on making a smaller more concise version and putting that up :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help understanding why my actionlistener is causing my program to freeze
 
Similar Threads
could someone look at my code and help me with a JScrollPane in a JTextPane please?
completely lost in terms of trying to understand Collections.synchronizedList
ActionListener problems
Just finished my first GUI program (a planner application) ... could you give me feedback?
Two separate classes (not inner classes) and ActionListener question