• 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

JInternalFrame force paint

 
Ranch Hand
Posts: 261
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: 261
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: 261
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.
 
ice is for people that are not already cool. Chill with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic