*
The moose likes Swing / AWT / SWT and the fly likes actionPerformed not being called properly by child component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "actionPerformed not being called properly by child component" Watch "actionPerformed not being called properly by child component" New topic
Author

actionPerformed not being called properly by child component

Ammar Karimi
Greenhorn

Joined: Apr 03, 2005
Posts: 5
Hi, I'm having a problem with the actionPerformed method, which is meant to respond to a button click. It's working fine in my parent class, but when I call the parent constructor (which creates the panel holding the button) through a child component, the button gets drawn correctly but does not respond to mouse clicks. Here is some of my parent code:


I have commented in capital letters at the point which I think is causing this problem... in the File Chooser example available on the web (FileChooserDemo.java), they use showOpenDialog(FileChooserDemo.this), whereas I am using null.
PS: I have another problem which I have commented in capital letters. After reading the file, I want to show the message Opening file: (file name) before disposing of the frame. However, when I tried to put a pause statement using a thread, or even just use a long for statement, in the place I have second place I have commented, it just drew a grey window, and then exited after the pause. If anyone knows how to resolve this problem too, that would be great. Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: actionPerformed not being called properly by child component
 
Similar Threads
Issue in launching a text file on Desktop.
How can i browse 3 files (same file format, exp: .txt) and process it ?
Saving an input.
JTextArea append() not working?
problem with Filechooser