java.util.*; 컬러 배열 개인 정적 색상 [] 색상 = {color.black, color.blue, color.cyan, color.green.orange, color.red, rel, color.light_gray}; random (); // 임의의 객체 생성 getc () {// 임의의 색상 값을 얻는 메소드 (new Runnable () {// 익명 스레드 개체 x = 30; // 초기를 정의합니다. int y = 50; public void run () {// 스레드 인터페이스 메소드 전체 (true) {// 스레드 .sleep (100); .printstacktrace ();} // 구성 요소 컨텍스트 객체 그래픽 그래픽 = getGraphics (); , y, 100, y ++); if (y> = 80) {y = 50;}}};// stark} public static void main (string [] args) {init (new sleepmethodtest (), 100, 100);} // 초기화 프로그램 인터페이스 공개 정적 void (jfreame frame, int wid th, int height) {{frame.setDefaultCloseOperation (jframe.exit_on_close); 프레임 .set -Visible (true); java의 휴면은 수면 () 메소드입니다. 스레드의 클래스.