• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

ugly gray background of applet

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What to do to avoid the ugly gray which displayed at the time of loading an applet?
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can try using getContentPane().setBackground(Color.red); to change the color. It works for me in some programs, but not in others, but you should try it.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing is, the background is supplied by the browser until the first show() of the applet.
If your init() takes a lot of time, the ugly gray will just sit there.
Make your init() very short and start a Thread that loads the reset of the applet.
Your paint() method should check on the loading process and show ... loading data
until the rest of the applet is loaded. This minimizes the amount of time the ugly gray shows.
Bill
 
If you're gonna buy things, buy this thing and I get a fat kickback:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic