분류 전체보기 (510) 썸네일형 리스트형 자바 IO 바이트기반 import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; public class FileEx1 { public static void main(String[] args){ //생성자에 경로 지정 생성자에 예외처리 해주어야함 FileInputStream fis = null; try{ fis = new FileInputStream("/home/whitefox/test.txt"); int data = 0; //문자에 대한 ASCII코드 while((data = fis.read()) != -1){ //ASCII값을 char로 형 변환 엔터키도 코드값으로 변환됨을 확인할 수 있 System.out... 자바 swing JTable 사용한 달력 import java.awt.BorderLayout; import java.awt.GridLayout; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.SwingUtilities; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; public class CalendarTableEx1 extends JFrame { private static final long serialVer.. 자바 Swing 구구단 import java.util.Vector; import javax.swing.table.AbstractTableModel; public class GugudanTableModel extends AbstractTableModel { String[] columnNames = { "X 1", "X 2", "X 3", "X 4", "X 5", "X 6", "X 7", "X 8", "X 9" }; Object[][] data = null; public GugudanTableModel() { } public GugudanTableModel(Object[][] data) { this.data = data; } public int getColumnCount() { return columnNames.length; } .. 자바 Swing import java.awt.*; import java.awt.event.*; import javax.swing.*; public class JTabbedPaneEx extends JFrame{ ImageIcon icon1, icon2, icon3, tabicon; JButton b1, b2, b3; JTabbedPane jp; public JTabbedPaneEx(){ super("JTabbedPane 테스트"); icon1=new ImageIcon("../../images/image3.gif"); icon2=new ImageIcon("../../images/image2.gif"); tabicon=new ImageIcon("../../images/image1.gif"); b1=new JButton("사.. AWT choice, list import java.awt.FileDialog; import java.awt.Frame; import java.awt.Menu; import java.awt.MenuBar; import java.awt.MenuItem; import java.awt.Panel; import java.awt.GridBagLayout; import java.awt.BorderLayout; import java.awt.TextField; import java.awt.Choice; import java.awt.Rectangle; import java.awt.Dimension; import java.awt.List; public class ChoiceEx2 extends Frame { private static final lon.. AWT 주민등록번호 검사 import java.awt.Frame; import java.awt.Dimension; import java.awt.Panel; import java.awt.GridBagLayout; import java.awt.BorderLayout; import java.awt.TextArea; import java.awt.TextField; import java.awt.GridBagConstraints; import java.awt.Label; import java.awt.FlowLayout; import java.awt.Button; public class JuminCheck extends Frame { private static final long serialVersionUID = 1L; private Pan.. AWT import java.awt.Frame; public class FrameEx2 extends Frame { public static void main(String[] args){ FrameEx2 f1 = new FrameEx2(); f1.setSize(400, 200); f1.setVisible(true); } } import java.awt.Frame; public class FrameEx2 extends Frame { public static void main(String[] args){ FrameEx2 f1 = new FrameEx2(); f1.setSize(400, 200); f1.setVisible(true); } } public class FrameEx3 extends Frame { publ.. 자바 달력 import java.util.*; public class Cal { public static void main(String[] args){ // int year = Integer.parseInt(args[0]); // int month = Integer.parseInt(args[1]); int year = 2009; int month = 4; Calendar fDay = Calendar.getInstance(); Calendar lDay = Calendar.getInstance(); fDay.set(year, month-1, 1); lDay.set(year, month-1, 0);//날짜입력 부분에 0을 입력하면 그 달의 마지막 값을 리턴 int START_DAY_OF_WEEK = fDay.get(Ca.. 이전 1 ··· 47 48 49 50 51 52 53 ··· 64 다음