• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

JInternalFrame force paint

 
Ranch Hand
Posts: 244
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Appologies in advance for not having some real code to look at but hopefully my pseudo code will be enough to illustrate what the problem is.

I  have a MDI application and in this particular scenario a JInternalFrame called AAAA creates an instance of another JInternalFrame called BBBB.

In the constructor for BBBB all the Swing layout and controls are drawn and only when the screen is complete does it execute a rather lengthy SQL SELECT to populate a JTable.

The problem I have is that because Swing is doing its screen painting in its own thread it does not have time to draw the BBBB frame before the SQL SELECT fires up and consumes all the spare CPU cycles.

This means that the BBBB frame simply does not appear at all until the query has completed.

I have tried inserting some delays / pauses at strategic points without luck.

Is there something I can put in the constructor of BBBB after the screen has been defined, but before the SQL is executed which will force Java to paint the screen..

Thanks in advance.

Dave
 
David Garratt
Ranch Hand
Posts: 244
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgot my example - this is the constructor for BBBB - appInit does the GUI layout.

 
David Garratt
Ranch Hand
Posts: 244
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AH - forget this question - I see now I made a silly mistake elsewhere in my code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!