GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Notizen

Graphics class

shanid m JAVA Englisch 3 Seiten

Inhalt der Notizen (3)

Seite 1

Graphics class

Graphics class include methods for drawing shapes from a single line to a polygon.

To text in different fonts.

To draw a shape on the screen we may call one of the methods available in the graphics class.

Seite 2

Graphics Methods

drawLine(x1,y1,x2,y2)

drawOval(x,y,height,width)

fillOval(x,y,height,width)

drawRect(top,left,width,height)

fillRect(top,left,width,height)

roundRect(int top,int left,int width,int height,int xdimension,int ydimension)

fillRoundRect(int top,int left,int width,int height,int xdimension,int ydimension)

drawArc(int top,int left,int width,int height,int start angle,int sweep angle)

fillArc(int top,int left,int width,int height,int start angle,int sweep angle)

drawPolygon(int x[],int y[],int no.of points)

fillPolygon(int x[],int y[],int no.of points)

drawString("string",x,y)

Seite 3

Sample Program

import java.awt.*;

import java.applet.*;

/*<applet code=abc height=100 width=100>

</applet>*/

public class abc extends Applet

{

public void paint(Graphics g1)

{

g1.drawOval(20,20,100,100);

g1.setColor(Color.green);

g1.fillOval(70,20,100,100);

}

}

Informationen

Beschreibung
JAVA Notiz am Graphics class, erstellt von shanid m am 10/10/2016.
Erstellt von
shanid m
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck