-
Applet : 그래픽 사용 - 사각형 그리기혼자서 공부하기/자바 2007. 3. 25. 17:13728x90반응형SMALL
애플릿에 사격형을 그리기 위해서는 drawRect()이나 fillRect() 메소드를 사용한다.
사각형을 그릴때 선의 두께를 1로 하기에
결과적으로는 이 사각형이 (width+1)너비와 (height+1)의 높이의 영역을 차지하게 됨..
메소드 정의
drawRect(int x, int y, int width, int height)
fillRect(int x, int y, int width, int height)
clearRect(int x, int y, int width, int height)
draw3DRect(int x, int y, int width, int height, boolean raised)
drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
매개변수
x, y : 사각형의 시작점의 x,y 좌표
width : 사각형의 가로 길이
height : 사각형의 세로 길이
raised : 사각형의 돌출 효과를 줄지의 여부
arcWidth : 4개의 모퉁이 수평 지름
arcHeight : 4개의 모퉁이 수직 지름
728x90반응형LIST'혼자서 공부하기 > 자바' 카테고리의 다른 글
Applet : 그래픽 사용 - 원호 그리기 (0) 2007.03.25 Applet : 그래픽 사용 - 사각형 그리기 (0) 2007.03.25 Applet : 그래픽 사용 - 선 그리기 (0) 2007.03.25 Applet : 그래픽 사용 - Frame 클래스 (0) 2007.03.25 Applet : 그래픽 사용 - 문자열 출력 (0) 2007.03.25