반응형 자바101 자바 소스코드: Drawing Line by Mouse 예제(repaint) package javaapplication16; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.*; class GraphicsDrawLineMouseEx extends JFrame{ GraphicsDrawLineMouseEx(){ this.setTitle("Drawing Line by Mouse 예제"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyPanel panel = new MyPanel(); this.add(panel); this.setLocationRelativeTo(null); this.s.. 2016. 11. 12. 자바 소스코드: Clip 사용 예제(클리핑) package javaapplication15; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class GraphicsClipEx extends JFrame{ GraphicsClipEx(){ this.setTitle("Clip 사용 예제"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyPanel panel = new MyPanel(); this.add(panel, BorderLayout.CENTER); this.setLocationRelativeTo(null); this.setSize(300,400); this.setVisibl.. 2016. 11. 12. 자바 소스코드: drawImage 사용 예제3(이미지의 일부분을 크기 조절하여 그리기 package javaapplication14; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class GraphicsDrawImageEx3 extends JFrame{ GraphicsDrawImageEx3(){ this.setTitle("drawImage 사용 예제2"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyPanel panel = new MyPanel(); this.add(panel, BorderLayout.CENTER); this.setLocationRelativeTo(null); this.setSize(300,40.. 2016. 11. 12. 자바 소스코드: drawImage 사용 예제2(패널의 크기에 맞추기) package javaapplication13; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class GraphicsDrawImageEx2 extends JFrame{ GraphicsDrawImageEx2(){ this.setTitle("drawImage 사용 예제2"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyPanel panel = new MyPanel(); this.add(panel, BorderLayout.CENTER); this.setLocationRelativeTo(null); this.setSize(300,40.. 2016. 11. 12. 이전 1 ··· 6 7 8 9 10 11 12 ··· 26 다음 반응형