반응형 자바101 자바 소스코드: ThreadTimer 예제 package javaapplication20; import java.awt.*; import javax.swing.*; class ThreadTimerEx extends JFrame{ JLabel la; ThreadTimerEx(){ this.setTitle("ThreadTimer 예제"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLayout(new FlowLayout()); MyThread th = new MyThread(); la=new JLabel(); la.setFont(new Font("Gothic", Font.ITALIC, 80)); this.add(la); this.setLocationRelativeTo(null); th.. 2016. 11. 12. 자바 소스코드: 스레드 생성,실행 예제 package javaapplication19; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class TimerThread extends Thread{ int n=0; public void run(){ while(true){ System.out.print(n++); try{ sleep(1000); } catch(Exception e){ return; } } } } public class JavaApplication19 { public static void main(String[] args) { TimerThread th = new TimerThread(); th.start(); }.. 2016. 11. 12. 자바 소스코드: 명품자바프로그래밍 오픈첼린지 12(클리핑 적용) package javaapplication18; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class ImagePanel extends JFrame{ final int MOVE=10; ImagePanel(){ this.setTitle("Open Challenge 12"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyPanel panel = new MyPanel(); this.add(panel, BorderLayout.CENTER); this.setLocationRelativeTo(null); this.setSize(400,40.. 2016. 11. 12. 자바 소스코드: 새로운 버튼 만들기(paintComponent 적용) package javaapplication17; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class paintComponentEx extends JFrame{ paintComponentEx(){ this.setTitle("새로운 버튼 만들기"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLayout(new FlowLayout()); MyButton btn = new MyButton("New Button"); btn.setBackground(Color.CYAN); btn.setOpaque(true); this.ad.. 2016. 11. 12. 이전 1 ··· 5 6 7 8 9 10 11 ··· 26 다음 반응형