¼Ò¼³ java.awt ¼Ò½ºÄڵ堠Shape  ¿©·¯ µµÇü ±×¸®±â  

¿©·¯°¡Áö µµÇüÀ» ±×¸®´Â ¿¹Á¦

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(  
004636true
);
            g.drawOval(
5004636
);
            
int x1[] = new int[] { 100300273 
};
            
int y1[] = new int[] {   0,   0,  36 
};
            g.drawPolygon(x1, y1, x1.length);
            g.setColor(Color.blue);
            g.fill3DRect(  
0404636true
);
            g.fillOval(
50404636
);
            
int x2[] = new int[] { 100300273 
};
            
int y2[] = new int[] {  40,  40,  76 
};
            g.fillPolygon(x2, y2, x2.length);
            g.drawLine(
1504039676
);
            g.setColor(Color.black);
            g.drawString(
"www.jabook.org"10115
);
            g.setColor(Color.cyan);
            g.drawRoundRect( 
012046361010
);
            g.fillRoundRect(
5012046361010
);
            g.clearRect(
303025030
);
         }
      });
   }
   
public static void 
main(String args[]) {
      GraphicsTest f = 
new 
GraphicsTest();
      f.setTitle(
"Graphics"
);
      f.setSize(
420200
);
      f.setVisible(
true
);
   }
}

C:\JavaExample\14>javac GraphicsTest.java
C:\JavaExample\14>java GraphicsTest

GraphicsŬ·¡½º´Â »ç°¢Çü, ¿ø, ´Ù°¢Çü, ¼±µî ¸¹Àº µµÇüÀ» ±×¸± ¼ö ÀÖ´Â ¸Þ¼­µå¸¦ Á¦°øÇÑ´Ù



jabookÀúÀÚ¸íÇÔ
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå
ÀÛ¼ºÀÚ:Àںϸâ¹ö ±è´ë¼º