scruppy 0 Report post Posted September 3, 2010 so for a class at school Im learning java and our assignment is to make a window with a pale green background and all i can make is a green one whats the code to change a color or make a new one? Share this post Link to post Share on other sites
web_designer 7 Report post Posted September 3, 2010 you can use this code to change the color of your background as you wish, just pick the desired color and press enter <FORM name="back"><SELECT name="g" onChange="change()"> <OPTION VALUE="aqua"> aqua <OPTION VALUE="green">green <OPTION VALUE="orange">orange <OPTION VALUE="yellow">yellow <OPTION VALUE="purple">purple <OPTION VALUE="gray">gray <OPTION VALUE="pink">pink <OPTION VALUE="lavender">lavender <OPTION VALUE="khaki">khaki <OPTION VALUE="skyblue">skyblue <OPTION VALUE="white" SELECTED>white</SELECT><INPUT TYPE="button" VALUE="choose color"></FORM><script language="Javascript"><!--function change() {document.bgColor = document.back.g.options[document.back.g.selectedIndex].value}//--></script> put this code between body tag, and notice that you can change the color of the background from the value attribute to whatever you want by using hexadecimal like adding the black color like this (#000000). and by the way i tested the code and it worked fine,good luck. Share this post Link to post Share on other sites