본문 바로가기

C.E/Java8

Class Jpanel, Method paintComponent paintComponentprotected void paintComponent(Graphics g) Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate). If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should.. 2008. 11. 25.
[event]Interface MouseListener java.awt.event Interface MouseListener public interface MouseListener extends EventListener //EventListener를 확장한 The listener interface for receiving "interesting" mouse events (press, release, click, enter, and exit) on a component. (To track mouse moves and mouse drags, use the MouseMotionListener.) The class that is interested in processing a mouse event either implements this interface (and .. 2008. 11. 25.
[Java] 스레드 -cpu 하나당 스레드 하나만 실행가능 -동기화 : 하나의 스레드만 접근 가능? thread_A.start(); thread_B.start(); -> CPU는 한번에 하나만 실행가능하기 떄문에 보이기에는 동시에 실행되는 것처럼 보이지만 사실은 번갈아가면서 실행. run() : 스레드 내부의 메인 함수와 비슷, 스레드를 START하면 시작된다. 오버라이드필수!! 2008. 11. 21.
[11월17일] 스레드 프로세서와 스레드는 다르다?? : 하나의 프로세서가 여러개의 스레드 사용 가능 프로세서 끼리는 메모리 공유를 하지 않는다. 하지만 스레드끼리는 서로 공유 익스플로러 -> 하나의 프로세서로 볼 수 있다. 멀티스레드 장점 : 공유하는 것들이 있기 떄문에 멀티프로세싱과는 다른 장점이 나타난다. -main 프로세서의 시작점, run은 메소드의 시작점 ppt9. 메인 프로세서와 스레드가 병렬로 처리중이다. 그래서 먼저 처리되는 명령어들이 화면에 출력된 것이다. 그래서 OS마다 그 출력값이 달라질 수도 있다. ppt[13] 스케줄링을받을수있는상태 ->즉 자원을 받을 수 있는 상태이다. ppt[14] 입출력을위해블록되었을때 -> 스레드를 기능단위로 나누는 경우도 있다. ppt[19] public static void.. 2008. 11. 17.