본문 바로가기
반응형

자바101

자바 소스코드: 스레드를 가진 겜블링 package javaapplication37; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.*; class Ex11 extends JFrame{ Ex11(){ this.setTitle("스레드를 가진 겜블링"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.add(new GamePanel()); this.setLocationRelativeTo(null); this.setSize(300, 200); this.setVisible(true); } class GamePanel extends JPane.. 2016. 11. 23.
자바 소스코드: 눈 내리는 풍경 package javaapplication36; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.*; class Ex10 extends JFrame{ Thread snow; SnowPanel sp; Ex10(){ this.setTitle("눈 내리는 풍경"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); sp=new SnowPanel(); this.setResizable(false); this.setLocationRelativeTo(null); this.add(sp); this.setSize(500,500).. 2016. 11. 23.
자바 소스코드: 스네이크 움직이기 package javaapplication35; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.*; class Ex9 extends JFrame{ GamePanel p; Ex9(){ this.setTitle("스네이크 움직이기"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); p=new GamePanel(); this.setLocationRelativeTo(null); this.setSize(400,400); this.setVisible(true); this.add(p); p.requestFocus(); .. 2016. 11. 23.
자바 소스코드: 369게임 둘이서 하기 package javaapplication34; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Ex8 extends JFrame{ Ex8(){ this.setTitle("369게임 둘이하기"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.add(new GamePanel()); this.setLocationRelativeTo(null); this.setSize(320, 300); this.setVisible(true); } class GamePanel extends JPanel{ TimerThread th;//카운트.. 2016. 11. 23.
반응형