We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e946ad commit 9fb81f5Copy full SHA for 9fb81f5
1 file changed
Graphics/Color/ColorDemo.java
@@ -0,0 +1,17 @@
1
+//print hello world in red color and gces in green and create red and green rectangle using applet
2
+import java.awt.*;
3
+import java.applet.Applet;
4
+
5
+/* <applet code = "ColorDemo" height = "300" width = "300"></applet> */
6
7
+public class ColorDemo extends Applet {
8
+ public void paint(Graphics g) {
9
+ g.setColor(new Color(255, 0, 0));
10
+ g.fillRect(60, 60, 40, 40);
11
+ g.drawString("Hello World", 40, 40);
12
+ g.setColor(new Color(0, 255, 0));
13
+ g.fillRect(90, 60, 40, 40);
14
+ g.drawString("GCES", 40, 80);
15
16
+ }
17
+}
0 commit comments