• Post Reply Bookmark Topic Watch Topic
  • New Topic

When are components actually painted?

 
Nicholas George
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kind of a follow up to my modality question, but seemed different enough to warrant a new thread...

So, I've been playing around a little with JFrames, specifically when their components get painted.

for instance, if I have somthing that looks like this,


the frame itself will be appear, but none of the components in it.
How do I make the frame appear during a long task? I guess I could multithread it, but that seem overcomplex.
 
Campbell Ritchie
Marshal
Posts: 52590
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure, but you ought only to do anything with the components in the Event Despatch Thread, so maybe if the connection takes a long time, the connection ought to have its own thread.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would be more easily answered with compilable code. I'm not asking to see your whole program, but rather you should consider condensing your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:

http://homepage1.nifty.com/algafield/sscce.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!