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..
public class StringFormatTest { public static void main(String[] args) {// TODO Auto-generated method stub String str;str = String.format("%d", 20); System.out.println("str = "+str);//str의 값 세팅, 20의 값을 가진 정수로 출력str = String.format("%10d", 40);System.out.println("str = "+str);//다시 정수형으로 세팅, 10칸의 공간에 오른쪽 정렬//비슷한 기능으로 System.printf() 메소드가 있다. //-> C언어의 printf()와 동일}} str = 20str = 40
public class StringTest { public static void main(String[] args) {// TODO Auto-generated method stub String str1 = "Hello Java";String str2 = "Hello Java";String str3 = new String("Hello Java");String str4 = new String("Hello Java");//같은 리터럴을 사용한 경우에는 문자열이 같다고 나오고//각각 메모리를 할당 받아서 대입하면 서로 다르다고 나온다. (서로 다른 객체)if(str1==str2)System.out.println("두 개의 문자열은 동일하다");elseSystem.out.println("두 개의 문자열은 서로 다..
- Total
- Today
- Yesterday
- ERP
- 자바
- 오라클
- JQuery
- jsp
- 클래스
- 배열
- 정보
- 안드로이드
- 도전과제
- 정렬
- db
- 자바스크립트
- SVN
- 게임
- 이론
- HTML
- 아두이노
- 청주
- 파이썬
- 프로젝트
- 메모장
- 충북대
- CSS
- 소켓
- 졸업작품
- 잡담
- SQL
- 데이터베이스
- 알고리즘
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |