Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Aggravating JWindow and JFrame Pop Up Window Problem  RSS feed

 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. this is driving me nuts..
I have a JWindow Pop Up Window.. works fine when I call it at the beginning of my program(just as a test). I removed the code at the beginning of my program and then put it later in my program before a processor intensive task(converting high rez images). Window pops up but without the contents. Any ideas? Only thing I thought of is it possibly starts to display the Window and then the intensive task takes over the CPU and the Pop Up Window contents are never drawn. Dont know if thats possible?? Should I try inserting some type of delay, if so, what is the easiest way? I have tried this with a JFrame and get the exact same results, seems like the JPanel is possbily not being drawn.
Thanks in advance...Please save me from going bonkers!
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm...I am not sure...is your program running in threads? If it is, you might want to take a look at this, as Swing is not thread safe.
Other than that, it might be an issue of system resources. Please post back when you find out. I'd be interested to know what you found.
Jason Steele
 
Tanveer Rameez
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u can try by displaying the JWindow in a separate thread.
 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ended up having to run both the JWindow and the File Conversion clss in seperate threads. Had to set the JWindow to Max Priority and the File Conversion class to Low Priority.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!