Study/Programming (82) 썸네일형 리스트형 자바 IO 문자기반 import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class FileEx6 { public static void main(String[] args){ FileReader fr = null; try { fr = new FileReader("/home/whitefox/test.txt"); int data = 0; // -1(마지막 값이 아니면 (char)data 실행 : 한글도 정상적으로 출력됨 //Byte기반과는 달리 이미지는 깨지는 경우도 발생 while((data = fr.read()) != -1){ System.out.print((char)data +" "); } } cat.. 자바 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.. 이전 1 ··· 5 6 7 8 9 10 11 다음