• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JLabel not displaying

 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created a custom modal dialog class that will pop-up, run some Runnable task, and then go away once the task is complete. It's a very basic window containing a single JLabel that displays some informational message to the user, like "Retrieving data...". Here is the code:

To use it, I am launching a new thread, something like this:

The problem is this: The first time I launch a new ModalDialog, it looks perfect - the window appears with the appropriate message. However, in subsequent uses, the JLabel does not appear so the user just sees a blank modal window. The only difference I can see is that the first launch occurs within the constuctor of my app whereas the subsequent launches originate through the event thread (e.g. user clicked a button). However, since in both cases, I run the ModalDialog in a new thread, it doesn't seem like that should matter.

I have tried many things such as calling repaint(), validate(), launching new threads, etc, etc.
Does anyone have any suggestions?
 
reply
    Bookmark Topic Watch Topic
  • New Topic