Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Application Gui Issue

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Application Gui Issue

    Hello all,
    i have created a application gui that use a SwingWorker to update a JTextArea and JTable into a loop. This works fine and the swing components are updated in real-time. My issues started when the frame is iconized and the process continues in background mode. When i deiconized the frame, some lines of my text aren't visible or some JTable's columns data aren't updated and i have to pass with mouse on the JTextArea or click on the JTable's columns to refresh them. I've tried to use a WindowsStateListener to catch when the frame is decoinized and to revalidate and repaint it but this didn't solve my problem.

    Do you have some ideas?

    Thanks a lot and sorry for my English


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Application Gui Issue

    Swing is not thread safe. Updating Swing components should be done on the EDT.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Application Gui Issue

    I've tried to execute updating into java.awt.EventQueue.invokeLater or into SwingUtilities.invokeLater methods but it still doesn't working.

    Do you have other ideas?

    Thanks a lot

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Application Gui Issue

    Not sure, but your description - iconized vs deiconized - gives the impression that the components are changing in which case you may need to revalidate() the container.

  5. #5
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Application Gui Issue

    Quote Originally Posted by GregBrannon View Post
    Not sure, but your description - iconized vs deiconized - gives the impression that the components are changing in which case you may need to revalidate() the container.
    Thanks for your response. I execute a process that write in a jtextArea and enable and disable some buttons but don't add or remove components to the JFrame. Now i'm trying to use a Windows Listener to catch when frame is deiconized and then revalide and repaint my frame. I'll alert you if this solve my problems.

    Thank you!

    --- Update ---

    I've solved problem with use revalidate and repaint into a Windows Listener.
    Thanks a lot.

    Regards

  6. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Application Gui Issue

    You're welcome. Glad you figured it out.

Similar Threads

  1. Issue while deploying JNLP application in Webspher Application Server.
    By nageshvk in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 11th, 2014, 09:12 AM
  2. RMI application connection issue
    By progkay7 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 21st, 2013, 05:35 AM
  3. GUI calculator issue
    By pricklygoo33 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 27th, 2013, 12:07 AM
  4. GUI issue
    By Pusillus in forum What's Wrong With My Code?
    Replies: 8
    Last Post: October 24th, 2012, 02:19 AM
  5. A GUI issue.
    By LasOz in forum What's Wrong With My Code?
    Replies: 9
    Last Post: March 9th, 2012, 12:46 AM