This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Applets and the fly likes Java applet window: color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Java applet window: color" Watch "Java applet window: color" New topic

Java applet window: color

Paresh Shah

Joined: Oct 09, 2003
Posts: 1
In my JDK 1.4 Swing code, I have a line that pops up a dialog:
JOptionPane.showMessageDialog(... "My message", ...);

During startup, I have set the background color:
ColorUIResource c = new ColorUIResource(new Color(237,237,237));
UIManager.put("OptionPane.background", c);
This just sets the backgroud color to a blue color.

This works fine when running as a Swing application. The dialog
shows up and has the blue color specified.
When running as an applet, the dialog gets a blue background,
but at the bottom is a label that reads "Java Applet Window"
and that portion of it has a different color (gray).
How can I fix this? Ideally, it would be nice if the Label/text itself
could go away. But if not, can I atleast change the color to match
the rest of the dialog window?
Thanks for your help.
wayne hitchcock

Joined: Dec 22, 2003
Posts: 8
Put this line in the init() method and your applet window background will be set to blue:
jQuery in Action, 3rd edition
subject: Java applet window: color
It's not a secret anymore!