|What is Applet?|
|Java Applet vs Application|
|Creating a Applet|
|Displaying Applet on Webpage|
|Passing Parameters to Applet|
|Setting Color to applet|
|Update and Repaint method|
|Using Fonts in Applet|
|Intro. to Graphics class|
|Drawing - Lines , Rectangles|
|Drawing - Circles and Ellipse|
|Drawing - Arcs|
|Drawing - Polygons|
|Drawing - Bar Charts|
|Java Keywords Dictionary|
|Java Interview Questions|
Graphics can be drawn with the help of java applet.
Java applets are written to draw lines,figures of different shapes,images and text in different styles even with the colours in display.
Every applet has it's own area of the screen known as canvas, where it creates the display in the area specified the size of applet's space is decided by the attributes of < applet ..> tag
A java applet draws graphical image inside it's space using the coordinate system as shown in above fig.
Java's coordinate system has the origin (0,0) in the upper-left corner, positive x values are to right and positive y values are to the bottom.
These coordinate values of x and y axis are in Pixels.
The graphics class of java includes methods for drawing different types of shapes,from line to polygons to text in a variety of fonts.
In applet, the paint() method and a Graphics class object is used to display text. To draw shapes on applet graphics class methods are used which of the have arguments representing ends points,corners in the coordinate system.
|drawRect()||This method draws a hollow rectangle|
|fillRect()||This method draws a filled rectangle|
|drawRoundRect()||This method draws a hollow rectangle with rounded corners.|
|fillRoundRect()||This method draws a filled rectangle with rounded corners.|
|drawPolygon()||This method draws a hollow polygon.|
|fillPolygon()||This method draws a filled polygon.|
|drawOval()||This method draws a hollow oval.|
|fillOval()||This method draws a filled oval.|
|drawArc()||This method draws a hollow arc.|
|fillArc()||This method draws a filled arc.|
|drawLine()||This method draws a straight line.|
|drawString()||This method displays a string text.|
|copyArea()||This method copies a rectangular area of the canvas to another area.|
|clearRect()||This method erases a rectangular are of the canvas.|
|getColor()||It retrives the current drawing colour|
|getFont()||It retrives the currently used font.|
|getFontMetrics()||It retrives information about the current font.|
|setColor()||Sets the drawing color.|