Swing
-
210826_JTable+JTextAreaSwing 2021. 8. 26. 17:31
public class JTable_01 extends JFrame{ Container cp; JTable tb1,tb2,tb3; JTextArea area; public JTable_01(String title) { super(title); cp=this.getContentPane(); cp.setBackground(new Color(171,190,190)); this.setBounds(700,100,800,800); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.initDesign(); this.setVisible(true); } public void initDesign() { this.setLayout(new GridLayout(2, 2, 5..
-
210826_JLabel+JTable+JTextAreaSwing 2021. 8. 26. 17:28
public class QuizJTable_02 extends JFrame { Container cp; JLabel lblTitle,lblOut; JTable table; JTextArea area; public QuizJTable_02(String title) { super(title); cp=this.getContentPane(); cp.setBackground(new Color(171,190,190)); this.setBounds(700,100,800,800); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.initDesign(); this.setVisible(true); } public void initDesign() { //이효리를 찍으면..
-
210826_JTable+JLabel+JButton+DefaultTableModelSwing 2021. 8. 26. 17:24
public class JTableAdd_03 extends JFrame implements ActionListener{ Container cp; JTextField tfSang,tfSu,tfDan; JButton btnAdd,btnDel; JLabel lbl1,lbl2,lbl3; DefaultTableModel model; JTable table; int selectRow=-1; //파일명 static final String FILENAME="/Library/sist0730/tdata.txt"; public JTableAdd_03(String title) { super(title); cp=this.getContentPane(); cp.setBackground(new Color(171,190,190));..
-
210824_Swing+label+Icon+DateSwing 2021. 8. 24. 17:48
public class SwingCompEx01 extends JFrame{ Container cp; JLabel label1,label2,label3,label4; Icon icon1=new ImageIcon("/Library/sist0730/image/img3.gif"); Icon icon2=new ImageIcon("/Library/sist0730/image/img6.gif"); JTextField text1; public SwingCompEx01(String title) { super(title); cp=this.getContentPane(); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setBounds(200,300,400,400); ..
-
210824_Swing+Checkbox+ActionListener+ItemListenerSwing 2021. 8. 24. 17:43
public class SwingCheckEx04 extends JFrame implements ActionListener,ItemListener{ Container cp; JCheckBox[] cbHobby=new JCheckBox[4]; JCheckBox cbDriver,cbBold; JButton btnHobby; JLabel lblResult; public SwingCheckEx04(String title) { super(title); cp=this.getContentPane(); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setBounds(700,100,400,400); cp.setBackground(new Color(151,190,2..
-
210824_Swing+Label+Button+Arrays+RandomSwing 2021. 8. 24. 17:38
public class SwingLabelGridEx05 extends JFrame { Container cp; JLabel[] lbl=new JLabel[9]; //공간만 할당받고 초기값 받은 거 아님 String []str={"한국","영국","프랑스","오스트리아","체코","헝가리","홍콩","미국","태국"}; JButton btn; public SwingLabelGridEx05(String title) { super(title); cp=this.getContentPane(); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setBounds(700,100,600,600); cp.setBackground(new Color(151,190,20..
-
210824_Swing+radiobutton+arrays+actionlistenerSwing 2021. 8. 24. 17:34
public class A_SwingRadioEx06 extends JFrame implements ActionListener{ Container cp; JRadioButton g[]= new JRadioButton[2]; JRadioButton c[]= new JRadioButton[3]; JLabel lbl; String gender[]= {"남자","여자"}; String color[]= {"Red","Blue","Pink"}; Color colors[]= {Color.RED,Color.BLUE,Color.PINK}; public A_SwingRadioEx06(String title) { super(title); cp=this.getContentPane(); this.setDefaultCloseOp..