/*******************************************************************************************************
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Main extends JFrame{
static JTextField la=new JTextField(" 7");
static int servive=7,f,sc,t;
static boolean da,enter=false;
static String str;
static JButton a=new JButton(),b=new JButton(),c=new JButton();
public Main() {
setVisible(true);
setSize(500,500);
Container co=getContentPane();
co.setLayout(null);
co.addMouseMotionListener(new Mouse());
co.addMouseWheelListener(new Mouse());
co.addKeyListener(new key());
co.setFocusable(true);
co.add(la);
co.add(a);
co.add(b);
co.add(c);
c.addKeyListener(new key());
c.setVisible(false);
c.setFocusable(true);
requestFocus();
a.addMouseMotionListener(new Mouse());
a.addMouseWheelListener(new Mouse());
b.addMouseMotionListener(new Mouse());
b.addMouseWheelListener(new Mouse());
la.addMouseMotionListener(new Mouse());
la.addMouseWheelListener(new Mouse());
la.setBackground(Color.green);
ImageIcon img = new ImageIcon("love-always-wins.png");
a.setIcon(img);
la.setLocation(200, 210);
la.setSize(30, 30);
}
public class key extends KeyAdapter {
public void keyTyped(KeyEvent e) {
if(e.getKeyChar()==str.charAt(0)) {
da=false;
}
}
}
public class Mouse implements MouseWheelListener,MouseMotionListener{
public void mouseWheelMoved(MouseWheelEvent e) {
int x=la.getLocation().x;
int y=la.getLocation().y;
la.setLocation(x, y+(e.getWheelRotation()*5));
}
public void mouseDragged(MouseEvent e) {
}
public void mouseMoved(MouseEvent e) {
int x=e.getLocationOnScreen().x;
int y=la.getLocation().y;
la.setLocation(x-20, y);
}
}
public static void Game() {
int i,j,score = 0;
double r,qwerty;
String s = null;
while(servive>0) {
r=Math.random();
zzz(500);
if(score==15||score==20) {
for(i=0;i<7;i++) {
c.setFocusable(true);
c.setBackground(Color.orange);
c.setVisible(true);
c.setLocation(0, 0);
c.setSize(500, 500);
switch(i) {
case(0):c.setText("click!");
da=false;break;
case(1):str="q";break;
case(2):str="w";break;
case(3):str="e";break;
case(4):str="r";break;
case(5):str="t";break;
case(6):str="y";break;
}
c.setText(str);
zzz(900);
if(da) {
c.setBackground(Color.red);
servive--;
}
da=true;
zzz(300);
c.setVisible(false);
zzz(1500);
}
}
else{
if(r<0.05) {
a(0,0,500,200);
b(0,263,500,200);
a.setBackground(Color.orange);
b.setBackground(Color.orange);
zzz(1500);
a.setBackground(Color.red);
b.setBackground(Color.red);
if(la.getLocation().y<200||la.getLocation().y>300) {
servive--;
}
}
else if(r<0.1) {
a(0,0,200,500);
b(300,0,200,500);
a.setBackground(Color.orange);
b.setBackground(Color.orange);
zzz(1000);
a.setBackground(Color.red);
b.setBackground(Color.red);
if(la.getLocation().x<200||la.getLocation().x>300) {
servive--;
}
}
else if(r<0.2) {
a(200,0,100,500);
b(0,190,500,100);
a.setBackground(Color.orange);
b.setBackground(Color.orange);
zzz(2000);
a.setBackground(Color.red);
b.setBackground(Color.red);
if((la.getLocation().x>200&&la.getLocation().x<300)||(la.getLocation().y>200&&la.getLocation().y<300)) {
servive--;
}
}
else if(r<0.3){
a(0,0,370,370);
b(100,100,400,400);
a.setBackground(Color.orange);
b.setBackground(Color.orange);
zzz(4000);
a.setBackground(Color.red);
b.setBackground(Color.red);
if((la.getLocation().x>100&&la.getLocation().x<400)||(la.getLocation().y>100&&la.getLocation().y<400)) {
servive--;
}
}
else if(r<0.45){
a.setVisible(true);
b.setVisible(true);
a.setSize(50,50);
b.setSize(50,50);
for(i=0;i<10;i++) {
for(j=0;j<10;j++) {
a.setLocation(i*50, j*50);
a.setBackground(Color.orange);
zzz(10);
a.setBackground(Color.red);
b.setLocation(i*50,j*50+50);
b.setBackground(Color.orange);
if(la.getLocation().x>i*50&&la.getLocation().x<i*50+50&&la.getLocation().y>j*50&&la.getLocation().y<j*50+50) {
servive--;
}
zzz(10);
b.setBackground(Color.red);
if(la.getLocation().x>i*50&&la.getLocation().x<i*50+50&&la.getLocation().y>j*50+50&&la.getLocation().y<j*50+100) {
servive--;
}
}
}
}
else if(r<0.55) {
c.setBackground(Color.orange);
c(0,0,500,500);
random();
c.setText(str);
zzz(1500);
if(da) {
c.setBackground(Color.red);
servive--;
}
da=true;
zzz(300);
c.setVisible(false);
}
else if(r<0.6) {
c(0,0,500,500);
c.setBackground(Color.orange);
random();
c.setText("@&$@#%#!%^");
zzz(3000);
if(da) {
servive--;
c.setBackground(Color.red);
}
zzz(500);
c.setVisible(false);
}
else if(r<0.75) {
a(0,0,250,500);
b(250,0,250,500);
a.setBackground(Color.orange);
b.setBackground(Color.orange);
zzz(1000);
for(i=0;i<4;i++) {
a.setBackground(Color.red);
if(la.getLocation().x<250) {
servive--;
}
zzz(500);
if(la.getLocation().x<250) {
servive--;
}
a.setBackground(Color.orange);
zzz(500);
b.setBackground(Color.red);
if(la.getLocation().x>250) {
servive--;
}
zzz(500);
b.setBackground(Color.orange);
if(la.getLocation().x>250) {
servive--;
}
zzz(500);
}
}
else if(r<0.87) {
a(240,240,0,0);
a.setBackground(Color.orange);
for(i=0;i<225;i++) {
a.setSize(a.getSize().height+2,a.getSize().width+2);
a.setLocation(a.getLocation().x-1,a.getLocation().y-1);
zzz(10);
}
a.setBackground(Color.red);
if(la.getLocation().x>50&&la.getLocation().x<450&&la.getLocation().y>50&&la.getLocation().y<450) {
servive--;
}
}
else if(r<0.9) {
}
zzz(500);
a.setVisible(false);
b.setVisible(false);
}
s=s.valueOf(servive);
la.setText(" "+s);
score++;
}
la.setText("점수:"+score);
la.setSize(100, 200);
}
private static void random() {
int random=((int)(Math.random()*23))+1;
str=str.valueOf((char)(random+96));
}
private static void zzz(int x) {
try{
Thread.sleep(x);
}catch(InterruptedException e){
e.printStackTrace();
}
}
private static void a(int x,int y,int w,int h) {
a.setLocation(x, y);
a.setSize(w, h);
a.setVisible(true);
}
private static void b(int x,int y,int w,int h) {
b.setLocation(x, y);
b.setSize(w, h);
b.setVisible(true);
}
private static void c(int x,int y,int w,int h) {
c.setLocation(x, y);
c.setSize(w, h);
c.setVisible(true);
}
public static void main(String[] args) {
new Main();
Game();
}
}*************************************************************************************************************/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Main extends JFrame{
public static void main(String[] args) {
}
}