¿©·¯°¡Áö µµÇüÀ» ±×¸®´Â ¿¹Á¦
GraphicsTest.java
import java.awt.*;
public class GraphicsTest extends Frame {
public GraphicsTest() {
add(new Canvas() {
public void paint(Graphics g) {
g.setColor(Color.red);
g.draw3DRect( 0, 0, 46, 36, true);
g.drawOval(50, 0, 46, 36);
int x1[] = new int[] { 100, 300, 273 };
int y1[] = new int[] { 0, 0, 36 };
g.drawPolygon(x1, y1, x1.length);
g.setColor(Color.blue);
g.fill3DRect( 0, 40, 46, 36, true);
g.fillOval(50, 40, 46, 36);
int x2[] = new int[] { 100, 300, 273 };
int y2[] = new int[] { 40, 40, 76 };
g.fillPolygon(x2, y2, x2.length);
g.drawLine(150, 40, 396, 76);
g.setColor(Color.black);
g.drawString("www.jabook.org", 10, 115);
g.setColor(Color.cyan);
g.drawRoundRect( 0, 120, 46, 36, 10, 10);
g.fillRoundRect(50, 120, 46, 36, 10, 10);
g.clearRect(30, 30, 250, 30);
}
});
}
public static void main(String args[]) {
GraphicsTest f = new GraphicsTest();
f.setTitle("Graphics");
f.setSize(420, 200);
f.setVisible(true);
}
}
GraphicsŬ·¡½º´Â »ç°¢Çü, ¿ø, ´Ù°¢Çü, ¼±µî ¸¹Àº µµÇüÀ» ±×¸± ¼ö ÀÖ´Â ¸Þ¼µå¸¦ Á¦°øÇÑ´Ù
jabookÀúÀÚ¸íÇÔ |
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå ÀÛ¼ºÀÚ:Àںϸâ¹ö ±è´ë¼º |