Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

Create simple applet, and print string in blue color

  1. /* Using Colors */
  2. /* Syntax
  3.  Color(int R, int G, int B)
  4.  Color(int rgb)
  5.  Color(float r, float g, float b)
  6. */
  7. /* Color Cosntants { black, blue, cyan, darkGray, gray, green, ligntGray,
  8.        magenta, orange, pink, red, white, yellow}
  9. */
  10.  
  11. import java.applet.Applet;
  12. import java.awt.Graphics;
  13. import java.awt.Color;
  14. /*
  15.  <applet code = "Applet03" width = 300 height = 300>
  16.  </applet>
  17. */
  18. public class Applet03 extends Applet
  19. {
  20.  public void paint(Graphics g)
  21.  {
  22.   g.setColor(Color.blue);
  23.   g.drawString("Hello World...",30,180);
  24.  }
  25. }
Your rating: None Average: 5 (1 vote)
Share this

Post new comment

4 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.