Skip to main content

[JAVA SWING] Problem visualize Jframe contents during the execution of an ActionPerformed

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
gtotto
Offline
Joined: 2012-03-28

Hi guys,

I'm new on the forum and i hope to be in the right section.
I'm already sorry for the bad english i will use: i hope you will understand the question.

I have a problem. :)

I have a Jframe "MAIN: with a Jbutton "START" which is related to an action.
The action should create a new JFrame "SECOND" with a Jmenu, a text Area showing a particular String and, after that, execute a procedure "LISTEN" which will monitor a directory.

The problem is that the program creates the Frame "SECOND" , but i cannot see and interact with the contents as long the procedure "LISTEN" is not terminated.
Considering that the procedure never ends without any signal.

How can I fix it?
Because i would like to have the Frame "SECOND" with an "Exit" Button in a "File" Jmenu in order to send a signal and interrupt the procedure LISTEN and eventually terminate the program.

Thank you in advance for the patience and the help.

Cheers

gtotto

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dubeypankaj88
Offline
Joined: 2012-03-29

hey put this procedure call in another thread. and start this thread on listen call.......so i think ur problem can be solved.