Question

In: Computer Science

URGENT!!!!!!!!!!!!!!!!!!!! Write an applet in Java that creates a yellow colored filled circle on screen. Inside...

URGENT!!!!!!!!!!!!!!!!!!!!

Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.  

Solutions

Expert Solution

For creating this application ,first create a java file named DrawCircl.java with following code,then run applet based on any following methods

DrawCircl.java file

import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;

public class DrawCircl extends Applet{

public void paint(Graphics g){

//set color to yello
setForeground(Color.yellow);

//draw a filled oval using fillOval(int x1,int y1, int width, int height) method of Graphics class.

//draw filled oval
g.fillOval(20,20,100,100);
//printing of string “GO” with Arial font and size 24, bold face
g.setColor(new Color(0, 100, 0));
g.setFont(new Font("Areal", Font.BOLD, 24));
g.drawString("GO", 20, 20);

}
}

Compilation Steps

1) Using appletviewer

javac DrawCircl.java

appletviewer DrawCircl.class

2)Using web browser

javac DrawCircl.java

create html file as follows

circle.html

<html>
  <head>
       <title>Circle Applet</title>
  </head>

  <body>
       <applet 
              code="DrawCircl.class" 
              height="250" 
              width="250">
       </applet>
  </body>
</html>

Related Solutions

Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.   answer within 25 min plzzz
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax. I need this answer ASAP PLZ.
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.  
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.  
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this...
Write an applet in Java that creates a yellow colored filled circle on screen. Inside this circle the word “GO” with Arial font and size 24, bold face needs to be printed. Justify your syntax.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT