Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame Problem

 
Eoin Mac Aoidh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
I am running a mapping application that accepts info from the user in a JFrame, and then loads a map according to his preferences in a second JFrame. I wish to load the layers of the map visually layer by layer. This works fine if I dont use two separate JFrames (if I hard code the user info) However... my problem occurs when I try to take the user info in the first frame, then load the map layers in the second... nothing displays until all the layers have loaded - then they all show togather!
The First frame appears to block the second one from rendering properly.
Any suggestions as to what the problem might be or a way around it?

Thanks,

Eoin.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Possibly this is a 'doing something time consuming on the Swing thread' problem? There was a nice little TechTips article about this recently.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first idea about this was that it might be a focus problem (j2se 1.4+) as pointed to in the isFocusableWindow method of the Window api. So I tried a couple of tests to see, one with loading components and the other with drawing images. Both worked just fine in j2se 1.5.
 
Eoin Mac Aoidh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stuart and Craig, I found a simple way around the problem: By using a coustom dialog for the user to enter his details, when the details are entered the dialog disposes and the main frame loads.

Thanks again,

Eoin.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!