본문 바로가기

Study

(184)
자바 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..
자바 컬렉션 프레임워크 import java.util.ArrayList; public class ListEx1 { public static void main(String[] agrs){ ArrayList ar1 = new ArrayList(); ArrayList ar2 = new ArrayList(100); ar1.add(1); ar1.add(new Integer(2)); //데이터의 갯수 System.out.println("ArrayList 사이즈 : " +ar1.size()); for(int i=0; i=0; i--){ if(list1.contains(list2.get(i))) list2.remove(i); } print(list1, list2); } static void print(ArrayList list1, Array..