Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- /* Using Colors */
- /* Syntax
- Color(int R, int G, int B)
- Color(int rgb)
- Color(float r, float g, float b)
- */
- /* Color Cosntants { black, blue, cyan, darkGray, gray, green, ligntGray,
- magenta, orange, pink, red, white, yellow}
- */
- import java.applet.Applet;
- import java.awt.Graphics;
- import java.awt.Color;
- /*
- <applet code = "Applet03" width = 300 height = 300>
- </applet>
- */
- public class Applet03 extends Applet
- {
- public void paint(Graphics g)
- {
- g.setColor(Color.blue);
- g.drawString("Hello World...",30,180);
- }
- }

Post new comment