Jump to Real's How-to Main page

Use the same background color as the browser

// in the HTML, use
//   PARAM NAME="bgColor" VALUE="B8B5AE"
//     (where VALUE is the same hexadecimal value
//     as the HTML COLOR value)
//   in the APPLET tag
// in the JAVA init method :
   Color bgcolor = new Color(
        Integer.valueOf(getParameter("BGCOLOR"), 16).intValue());
   setBackground(bgcolor);

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]