////import java.util.Scanner;
////
////abstract class Converter {
////
//// abstract protected double convert(double src);
////
//// abstract protected String getSrcString();
////
//// abstract protected String getDestString();
////
//// protected double ratio;
////
//// public void run() {
////
//// Scanner scanner = new Scanner(System.in);
////
//// System.out.println(getSrcString() + "을" + getDestString() + "로 바꿉니다.");
////
//// System.out.print(getSrcString() + "을 입력하세요>>");
////
//// double val = scanner.nextDouble();
////
//// double res = convert(val);
////
//// System.out.println("변환결과: " + res + getDestString() + "입니다");
////
//// scanner.close();
////
//// }
////
////}
////
////class Km2Mile extends Converter
////
////{
////
//// public Km2Mile(double res)
////
//// {
////
//// this.ratio = res;
////
//// }
////
//// protected double convert(double src) {
////
//// return src / ratio;
////
//// }
////
//// protected String getSrcString() {
////
//// return "Km";
////
//// }
////
//// protected String getDestString() {
////
////// TODO Auto-generated method stub
////
//// return "mile";
////
//// }
////
////}
////
////class Main {
////
//// public static void main(String[] args) {
////
//// Km2Mile toMile = new Km2Mile(1.6);
////
//// toMile.run();
////
//// }
////
////}
///*
//class Point{
// private int x,y;
// public Point(int x,int y) {this.x=x;this.y=y;}
// public int getX() {return x;}
// public int getY() {return y;}
// protected void move(int x,int y) {this.x=x; this.y=y;}
//}
//
//class ColorPoint extends Point
//{
// String color;
// public ColorPoint()
// {
// this(0,0);
// }
// public ColorPoint(int x,int y)
// {
// super(x,y);
// color="black";
// }
// public void setColor(String color)
// {
// this.color=color;
// }
// public void setXY(int x,int y)
// {
// move(x,y);
// }
// public String toString()
// {
// return color+"색의 ("+getX()+","+getY()+")의 점 ";
// }
//
//}
//
//class Main
//{
// public static void main(String[] args) {
// ColorPoint zeroPoint=new ColorPoint();
// System.out.println(zeroPoint.toString()+"입니다.");
//
// ColorPoint cp =new ColorPoint(10,10);
// cp.setXY(5,5);
// cp.setColor("RED");
// System.out.println(cp.toString()+"입니다.");
// }
//}
//*/
///*
//GUI : Graphical User Interface (그림으로 사용자와 소통)
//
//컨테이너 : 종이 (프레임frame,패널panel 등등 )
//컴포넌트 : 스티커 (버튼, 레이블, 텍스트필드 등등)
//
//swing vs awt
//*/
///* gui 기본 틀!!!!
//import java.awt.*;
//import javax.swing.*;
//
//class Main extends JFrame{
// public Main() {
// //컨테이너.. 컴포넌트.. 이런거 설정
// setSize(500, 300); // 필수) 프레임 크기 설정 (가로길이,세로길이)
// setVisible(true); // 필수) 프레임을 보여주겠습니다!
// }
// public static void main(String[] args) {
// Main m = new Main(); // 메인 객체 생성
// }
//}
//*/
///*
//import java.awt.*;
//import javax.swing.*;
//
//class Main extends JFrame{
// public Main() {
// setTitle("지성이의 첫 GUI"); //프레임 제목 설정
// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //창닫으면 프로그램종료
// Container c = getContentPane(); // 프레임의 이름을 c로 하겠다!
// c.setBackground(Color.orange); // 프레임c의 배경색 설정
// c.setLayout(new FlowLayout()); // 프레임c의 배치관리자 설정
//
// JLabel la = new JLabel("지성아안녕!"); // 레이블? 라벨? 생성
// la.setForeground(Color.BLUE); // 라벨의 글자색 파란색으로 설정
// c.add(la); // 프레임에 라벨 추가
//
//
// JButton b1 = new JButton("press!"); // 버튼 생성
// b1.setBackground(Color.RED); // 배경색 설정
// b1.setForeground(Color.white);// 글자색 설정
// c.add(b1);
//
// JTextField tf = new JTextField("아이디를 입력하세요!"); //텍스트필드 생성
// c.add(tf);
//
// c.add(new JButton("exit")); // 이름이 없는 버튼을 생성하면서 프레임에 바로 추가
// // (나중에 얘를 변경하려면 쪼금 힘들어짐..)
//
// setSize(1000, 200); // 필수) 프레임 크기 설정 (가로길이,세로길이)
// setVisible(true); // 필수) 프레임을 보여주겠습니다!
// }
//
// public static void main(String[] args) {
// Main m = new Main(); // 메인 객체 생성
// }
//}
//*/
//import java.awt.*;
//import javax.swing.*;
//
//class Main extends JFrame
//{
// public Main(){
//
// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Container c=getContentPane();
//
// setSize(500,300);
// setVisible(true);
// }
// public static void main(String[] args) {
// new Main();
// }
//}
import java.util.*;
import java.awt.*;
import javax.swing.*;
class Board extends JFrame{
public void print(){
//System.out.print();
}
}
class AaaEx extends JFrame
{
public AaaEx() {
setTitle("ContentPane과 JFrame");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container aaa = getContentPane();
aaa.setBackground(Color.WHITE);
aaa.setLayout(new FlowLayout());
aaa.add(new JButton("ESC"));
JButton x = new JButton(" ");
x.setBackground(Color.WHITE);
aaa.add(x);
aaa.add(new JButton("F1"));
aaa.add(new JButton("F2"));
aaa.add(new JButton("F3"));
aaa.add(new JButton("F4"));
JButton y = new JButton(" ");
y.setBackground(Color.WHITE);
aaa.add(y);
JButton[] btns = new JButton[4];
for (int i = 0; i < btns.length; i++) {
btns[i] = new JButton("F" + (i + 5));
aaa.add(btns[i]);
}
// aaa.add(new JButton("F5"));
// aaa.add(new JButton("F6"));
// aaa.add(new JButton("F7"));
// aaa.add(new JButton("F8"));
JButton z = new JButton(" ");
z.setBackground(Color.WHITE);
aaa.add(z);
aaa.add(new JButton("F9"));
aaa.add(new JButton("F10"));
aaa.add(new JButton("F11"));
aaa.add(new JButton("F12"));
JButton a = new JButton(" ");
a.setBackground(Color.WHITE);
aaa.add(a);
aaa.add(new JButton("PrtSc"));
aaa.add(new JButton("ScrLk"));
aaa.add(new JButton("Pause"));
aaa.add(new JButton("[Color]"));
JButton b = new JButton(" ");
b.setBackground(Color.WHITE);
aaa.add(b);
aaa.add(new JButton("`~"));
aaa.add(new JButton(" 1 !"));
aaa.add(new JButton(" 2 @"));
aaa.add(new JButton("3 #"));
aaa.add(new JButton("4 $"));
aaa.add(new JButton("5 %"));
aaa.add(new JButton("6 ^"));
aaa.add(new JButton("7 &"));
aaa.add(new JButton("8 *"));
aaa.add(new JButton("9 ("));
aaa.add(new JButton("0 )"));
aaa.add(new JButton("- _"));
aaa.add(new JButton("= +"));
aaa.add(new JButton(" <~~~~~~~~~~"));
JButton c = new JButton(" ");
c.setBackground(Color.WHITE);
aaa.add(c);
aaa.add(new JButton("Ins"));
aaa.add(new JButton("Home"));
aaa.add(new JButton("PgUp"));
JButton d = new JButton(" ");
d.setBackground(Color.WHITE);
aaa.add(d);
aaa.add(new JButton("Num"));
aaa.add(new JButton(" / "));
aaa.add(new JButton(" * "));
aaa.add(new JButton(" - "));
aaa.add(new JButton(" Tab "));
aaa.add(new JButton("Qㅂ"));
aaa.add(new JButton("Wㅈ"));
aaa.add(new JButton("Eㄷ"));
aaa.add(new JButton("Rㄱ"));
aaa.add(new JButton("Tㅅ"));
aaa.add(new JButton("Yㅛ"));
aaa.add(new JButton("Uㅕ"));
aaa.add(new JButton("Iㅑ"));
aaa.add(new JButton("Oㅐ"));
aaa.add(new JButton("Pㅔ"));
aaa.add(new JButton("[{"));
aaa.add(new JButton("]}"));
aaa.add(new JButton(" \\|W "));
JButton e = new JButton(" ");
e.setBackground(Color.WHITE);
aaa.add(e);
aaa.add(new JButton("Del "));
aaa.add(new JButton(" End "));
aaa.add(new JButton("PrDn"));
JButton g = new JButton(" ");
g.setBackground(Color.WHITE);
aaa.add(g);
aaa.add(new JButton(" 7 "));
aaa.add(new JButton(" 8 "));
aaa.add(new JButton(" 9 "));
aaa.add(new JButton(" + "));
aaa.add(new JButton(" CapsLock "));
aaa.add(new JButton("Aㅁ"));
aaa.add(new JButton("Sㄴ"));
aaa.add(new JButton("Dㅇ"));
aaa.add(new JButton("Fㄹ"));
aaa.add(new JButton("Gㅎ"));
aaa.add(new JButton("Hㅗ"));
aaa.add(new JButton("Jㅓ"));
aaa.add(new JButton("Kㅏ"));
aaa.add(new JButton("Lㅣ"));
aaa.add(new JButton(";:"));
aaa.add(new JButton(" ' "));
aaa.add(new JButton(" Enter "));
JButton h = new JButton(
" ");
h.setBackground(Color.WHITE);
aaa.add(h);
aaa.add(new JButton(" 4 "));
aaa.add(new JButton(" 5 "));
aaa.add(new JButton(" 6 "));
aaa.add(new JButton(" + "));
aaa.add(new JButton(" Shift "));
aaa.add(new JButton("Zㅋ"));
aaa.add(new JButton("Xㅌ"));
aaa.add(new JButton("Cㅊ"));
aaa.add(new JButton("Vㅍ"));
aaa.add(new JButton("Nㅜ"));
aaa.add(new JButton("Mㅡ"));
aaa.add(new JButton(" , < "));
aaa.add(new JButton(" . > "));
aaa.add(new JButton(" / ? "));
aaa.add(new JButton(" Shift "));
JButton I = new JButton(" ");
I.setBackground(Color.WHITE);
aaa.add(I);
aaa.add(new JButton("I"));
JButton J = new JButton(" ");
J.setBackground(Color.WHITE);
aaa.add(J);
aaa.add(new JButton(" 1 "));
aaa.add(new JButton(" 2 "));
aaa.add(new JButton(" 3 "));
aaa.add(new JButton("Enter"));
aaa.add(new JButton(" Ctrl "));
aaa.add(new JButton(" [] & "));
aaa.add(new JButton(" Alt "));
aaa.add(new JButton(" ----------------- "));
aaa.add(new JButton("Alt 한/영"));
aaa.add(new JButton(" Fn "));
aaa.add(new JButton(" [], "));
aaa.add(new JButton("Ctrl 한자"));
JButton k = new JButton(" ");
k.setBackground(Color.WHITE);
aaa.add(k);
aaa.add(new JButton("--"));
aaa.add(new JButton("|"));
aaa.add(new JButton("--"));
JButton l = new JButton(" ");
l.setBackground(Color.WHITE);
aaa.add(l);
aaa.add(new JButton(" 0 "));
aaa.add(new JButton(" . Del "));
aaa.add(new JButton("Enter"));
setSize(1400, 600);
setVisible(true);
}
}
class Main {
public static void main(String[] args) {
new AaaEx();
}
}