Results 1 to 4 of 4
  1. #1
    gtotto is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Problem visualize Jframe contents during the execution of an ActionPerformed

    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

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Problem visualize Jframe contents during the execution of an ActionPerformed

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

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,041
    Rep Power
    10

    Default Re: Problem visualize Jframe contents during the execution of an ActionPerformed

    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    gtotto is offline Member
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Re: Problem visualize Jframe contents during the execution of an ActionPerformed

    OK guys, sorry for the "cross-posting" and thank for the help.

    I've still serious problem, even if i have understood a little the theory, i cannot implement the thing using the swing worker thread.

    Normally I have a button.

    I add the button a new ActionListener.

    The ActionEvent related should does :

    1- Open a new Frame with some features and i would like to associate this operation to a Swing Worker, because i need user is allowed to interact with it,

    in this case for example i don't understand where should i define the frame. In "doinBackground" or in the method "done()"?

    2- Another Frame where is running a procedure, which is cycling into a while(true).

    How should i do?

    Could someone suggest me the structure?

    Thank you,

    gtotto

Similar Threads

  1. How To Make JFrame Invisible And Contents Visible?
    By Kuttappu in forum Advanced Java
    Replies: 3
    Last Post: 01-06-2012, 07:52 AM
  2. Replies: 6
    Last Post: 11-30-2011, 09:39 PM
  3. Replies: 1
    Last Post: 04-10-2011, 03:06 PM
  4. Replies: 1
    Last Post: 02-20-2009, 04:49 PM
  5. actionPerformed problem
    By tomitzel in forum New To Java
    Replies: 1
    Last Post: 01-08-2008, 07:10 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
  •