본문 바로가기

Java

Chapter 10. AWT & Applet Chapter 10. AWT & Applet 1. AWT(Abstract Window Toolkit) - GUI Programming을 하기 위한 도구 - GUI Application의 개발에 필요한 여러 개의 관련 Package와 Class의 집합으로 구성 - 특징 · AWT로 작성된 GUI Application은 Platform에 독립적이기 때문에 여러 종류 OS에서 Code를 수정하지 않고 실행이 가능 · Windows Button과 같은 GUI Component를 직접 구현하지 않고 해당 OS의 Native Component를 사용하기 때문에 AWT로 작성된 GUI Application의 외형은 실행되는 OS마다 달라질 수 있다. · 여러 종류의 GUI 기반의 OS들이 공통적으로 가지고 있는 Co.. 더보기
AWT Method II Font Method Explain Font(String name, int style, int size) name : 사용할 Font의 이름 style : Font의 Style 지정 size : Font의 크기 Color Method Explain Color(int r, int g, int b) 0~255의 정수 값을 이용해 색 조절(r : red / g : green / b : blue) Color(float r, float g, float b) 0.0~1.0의 정수 값을 이용해 색 조절(r : red / g : green / b : blue) Color(int r, int g, int b, int a) a : Alpha 값이 추가되어 있으며 0~255사이의 정수 값을 갖음 Color(float r, .. 더보기
AWT Method I Container Method Explain Color getBackground() Component의 배경색을 얻음 void setBackground(Color c) Component의 배경색을 지정된 색으로 변경 Cursor getCursor() Component에 지정된 Cursor를 얻음 void setCursor(Cursor c) Component의 Cursor를 지정 Font getFont() Component에 지정되어 있는 Font를 얻음 void setFont(Font f) Component의 Font를 지정 Color getForeground() Component의 전경색을 얻음 void setForeground(Color c) Component의 전경색을 지정 int getHeigth.. 더보기
Thread Method Explain Thread() Thread의 생성자 Thread(ThreadGroup group, String name) ThreadGroup을 지정하는 Thread 생성자 Thread(ThreadGroup group, Runnable target) Thread(ThreadGroup group, Runnable target, String name) Thread(ThreadGroup group, Runnable target, String name, long stackSize) Thread currentThread() 현재 실행중인 Thread의 참조를 반환 String getName() Thread의 이름을 반환 run() 호출한 Method 내에서 Thread로 작업 진행 start() 호출.. 더보기
Chapter 9. Thread Chapter 9. Thread1. Process & Thread - Process · 실행 중인 Program을 지칭하며 Program을 실행 하면 OS로부터 실행에 필요한 자원을 할당받아 Process가 된다. · Process는 Program을 수행하는데 필요한 Data, Memory, Resource, Thread로 구성된다. · Process 내에는 최소한 하나 이상의 Thread가 존재한다. · Process의 Memory 한계(Call Stack의 크기)에 따라 Process 내에 생성할 수 있는 Thread의 수가 결정된다. · Multi-Threaded Process ◦ Process 내에 둘 이상의 Thread가 존재하는 Process ◦ 여러 Thread가 하나의 Process 내에서.. 더보기
Random Method Explain Random() System.현재시간을 Seed 값으로 사용하는 Random Instance를 생성 Random(long seed) 매개변수 Seed를 Seed 값으로 사용하는 Random Instance를 생성 Boolean nextBoolean() boolean Type의 난수를 반환 void nextBytes(byte[] bytes) Byte 배열에 Byte Type의 난수를 채워 반환 double nextDouble() Double Type의 난수를 반환 float nextGaussian() float Type의 난수를 반환 double nextGaussian() 평균은 0.0이고 표준편차는 1.0인 Gaussian 분포에 따른 double 형 난수를 반환 int nex.. 더보기
Properties MethodExplain Properties() Properties 객체 생성 Properties(Properties defaults) 지정된 Properties에 저장된 목록을 가진 Properties() 객체 생성 String getProperty(String key) 지정된 Key의 Value를 반환 String getProperty(String key, String defaultValue) 지정된 Key의 Value를 반환(Key를 못 찾을 시 defaultValue 반환) void list(PrintStream out) 지정된 PrintStream에 저장된 목록 출력 void list(PrintWriter out) 지정된 PrintWriter에 저장된 목록 출력 void load(InputStr.. 더보기
TreeMap Method Explain TreeMap() TreeMap 객체 생성 TreeMap(Comparator c) 지정한 Comparator를 기준으로 정렬하는 TreeMap 객체를 생성 TreeMap(Map m) 주어진 Map에 저장된 모든 요소를 포함하는 TreeMap을 생성 TreeMap(SortedMap m) 주어진 SortedMap에 저장된 모든 요소를 포함하는 TreeMap을 생성 void clear() TreeMap에 저장된 모든 객체를 제거 Object clone() 현재 TreeMap을 복제해서 반환 Comparator comparator() TreeMap의 정렬기준이 되는 Comparator를 반환(지정되지 않으면 null 반환) boolean containsKey(Object key) Tr.. 더보기
HashMap MethodExplain HashMap() HashMap 객체 생성 HashMap(int initialCapacity) 지정된 값을 초기용량으로 하는 HashMap 객체를 생성 HashMap(int initialCapacity, float loadFactor) 지정된 초기용량과 load factor의 HashMap 객체를 생성 HashMap(Map m) 주어진 Map에 저장된 모든 요소를 포함하는 HashMap을 생성 void clear() HashMap에 저장된 모든 객체를 제거 Object clone() 현재 HashMap을 복제해서 반환 boolean containsKey(Object key) HashMap에 지정된 Key가 포함되어있는지 확인 boolean containsValue(Object v.. 더보기
TreeSet Method Explain TreeSet() 기본 생성자 TreeSet(Collection c) 주어진 Collection을 저장하는 TreeSet을 생성 TreeSet(Comparator c) 주어진 정렬조건 정렬하는 TreeSet을 생성 TreeSet(SortedSet s) 주어진 SortedSet을 구현한 Collection을 저장하는 TreeSet을 생성 boolean add(Object o) boolean addAll(Collection c) 지정된 객체 또는 Collection의 객체들을 Collection에 추가 void clear() 저장된 모든 객체를 삭제 Object clone() TreeSet을 복제하여 반환 Comparator comparator() TreeSet의 정렬기준(Comp.. 더보기