class FlowLayoutTest extends Frame {public FlowLayoutTest(String str) {super(str); FlowLayout fl = new FlowLayout();Button btn[] = new Button[10]; setLayout(fl);for (int i = 0; i < 10; i++) {btn[i] = new Button((i + 1) + "번 버튼");add(btn[i]);}setBounds(100, 100, 200, 200);setVisible(true);}} public class FlowLayoutMain { public static void main(String[] args) {// TODO Auto-generated method stubne..
class MenuTest extends Frame {public MenuTest(String str) {super(str); MenuBar mb = new MenuBar(); //메뉴바 생성Menu file = new Menu("File"); //메뉴 객체 생성MenuItem file_new = new MenuItem("new item");MenuItem file_open = new MenuItem("open");MenuItem file_delete = new MenuItem("delete");MenuItem file_save = new MenuItem("save");//세부 메뉴 생성 file.add(file_new);file.add(file_open);file.add(file_delete);file..
class TextAreaText extends Frame {public TextAreaText(String str) {super(str); Panel p = new Panel();//TextArea txt1 = new TextArea(10,30); //행열 크기 10x30TextArea txt1 = new TextArea("good",15,35); // +@ 초기 문자 셋팅TextField txt2 = new TextField("Hello Java", 20); //txt1.setText("Java World");txt1.setBackground(Color.DARK_GRAY); //영역 배경색 지정txt1.setFont(new Font("굴림체",Font.BOLD,10)); //폰트 지정txt1.setF..
class TextFieldTest extends Frame {public TextFieldTest(String str) {super(str);Panel p = new Panel();Label lb01 = new Label("ID");Label lb02 = new Label("PASSWORD");// 두 개의 레이블(텍스트) 생성 TextField txt01 = new TextField(20);TextField txt02 = new TextField(20);// 텍스트필드 생성, 글자수는 20 txt02.setEchoChar('*'); // txt02, 즉 패스워드의 글자를 *로 치환p.add(lb01);p.add(txt01);p.add(lb02);p.add(txt02);add(p);setSize(300..
class ListTest extends Frame{public ListTest(String str){super(str);Panel p = new Panel();List list = new List();//List list = new List(2);//List list = new List(5, true); //숫자만큼의 항목을 보여주고 멀티 선택이 가능list.add("수곡동");list.add("도곡동");list.add("둔산동");list.add("사직동");list.add("개신동");p.add(list);add(p);setSize(300,300);setVisible(true);}} public class ListMain { public static void main(String[] args) {..
//Label을 상속받는 깜박임레이블 클래스를 정의한다.class FlickeringLabel extends Label implements Runnable {public FlickeringLabel(String str) {super(str); // 스레드 생성 및 시작Thread thread = new Thread(this);thread.start();} @Overridepublic void run() {// TODO Auto-generated method stubint n = 0;while (true) {if (n == 0)setBackground(Color.YELLOW);elsesetBackground(Color.GREEN);if (n == 0)n = 1;elsen = 0;try {Thread.sle..
import java.awt.Color;import java.awt.Frame;import java.awt.Label;import java.awt.Panel; class LabelTest extends Frame{Panel p;Label label1, label2, label3;public LabelTest(){setTitle("Label Test");p = new Panel();label1 = new Label("개신동");label2 = new Label("모충동");label3 = new Label("수곡동");label1.setBackground(Color.yellow);label2.setBackground(Color.BLUE);label3.setBackground(Color.blue);//Blu..
컴파일할 때 데이터 타입을 확정짓지 않고 실행 시 데이터 타입을 확정짓는 것을 의미다른 언어의 템플릿 기능과 유사 , 즉 미지정 자료형을 사용 컴파일 시에 타입이 결정되어 보다 안전한 프로그래밍 가능개발 시 다운캐스팅(타입 캐스팅) 절차 불필요런타임 타입 충돌 문제 방지 ClassCastException 방지 class Generic {private T data[]; public Generic(T... n) {data = n; // 미확정자료형인 T타입의 n을 인자로 받아 data에 대입} public void disp() {for (T i : data) {System.out.print(i+"\t");}}} public class GenericMain { public static void main(Str..
- Total
- Today
- Yesterday
- 배열
- 정보
- db
- ERP
- 파이썬
- 오라클
- 클래스
- 프로젝트
- SVN
- jsp
- 정렬
- CSS
- 게임
- SQL
- 졸업작품
- 자바
- JQuery
- 잡담
- 자바스크립트
- 안드로이드
- 아두이노
- 알고리즘
- 도전과제
- 청주
- HTML
- 충북대
- 소켓
- 메모장
- 이론
- 데이터베이스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |