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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | package com.jse.member; import java.awt.Container; import java.awt.Font; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextArea; import javax.swing.JTextField; public class MemberView extends JFrame { private static final long serialVersionUID = 1L; private Container container; private JLabel title,nameLabel,useridLabel,passwordLabel, ssnLabel,addrLabel; private JTextField nameText, useridText, passwordText, ssnText, addrText; private JTextArea resultText; private JButton submitButton, listButton; public MemberService memberService; public void open(){ memberService = new MemberServiceImpl(); setTitle("Swing Exercise"); setBounds(300, 90, 900, 600); setDefaultCloseOperation(EXIT_ON_CLOSE); setResizable(false); container = getContentPane(); container.setLayout(null); title = new JLabel("Swing Form"); title.setFont(new Font("Arial", Font.PLAIN, 30)); title.setSize(300, 30); title.setLocation(300, 30); container.add(title); nameLabel = new JLabel("Name"); nameLabel.setFont(new Font("Arial", Font.PLAIN, 20)); nameLabel.setSize(100, 20); nameLabel.setLocation(100, 100); container.add(nameLabel); nameText = new JTextField(); nameText.setFont(new Font("맑은고딕", Font.PLAIN, 15)); nameText.setSize(190, 20); nameText.setLocation(200, 100); container.add(nameText); useridLabel = new JLabel("Userid"); useridLabel.setFont(new Font("Arial", Font.PLAIN, 20)); useridLabel.setSize(100, 20); useridLabel.setLocation(100, 150); container.add(useridLabel); useridText = new JTextField(); useridText.setFont(new Font("맑은고딕", Font.PLAIN, 15)); useridText.setSize(150, 20); useridText.setLocation(200, 150); container.add(useridText); passwordLabel = new JLabel("Password"); passwordLabel.setFont(new Font("Arial", Font.PLAIN, 20)); passwordLabel.setSize(100, 20); passwordLabel.setLocation(100, 200); container.add(passwordLabel); passwordText = new JTextField(); passwordText.setFont(new Font("맑은고딕", Font.PLAIN, 15)); passwordText.setSize(150, 20); passwordText.setLocation(200, 200); container.add(passwordText); ssnLabel = new JLabel("SSN"); ssnLabel.setFont(new Font("Arial", Font.PLAIN, 20)); ssnLabel.setSize(100, 20); ssnLabel.setLocation(100, 250); container.add(ssnLabel); ssnText = new JTextField(); ssnText.setFont(new Font("맑은고딕", Font.PLAIN, 15)); ssnText.setSize(150, 20); ssnText.setLocation(200, 250); container.add(ssnText); addrLabel = new JLabel("Address"); addrLabel.setFont(new Font("Arial", Font.PLAIN, 20)); addrLabel.setSize(100, 20); addrLabel.setLocation(100, 300); container.add(addrLabel); addrText = new JTextField(); addrText.setFont(new Font("맑은고딕", Font.PLAIN, 15)); addrText.setSize(150, 20); addrText.setLocation(200, 300); container.add(addrText); submitButton = new JButton("Submit"); submitButton.setFont(new Font("Arial", Font.PLAIN, 15)); submitButton.setSize(100, 20); submitButton.setLocation(150, 450); container.add(submitButton); listButton = new JButton("List"); listButton.setFont(new Font("Arial", Font.PLAIN, 15)); listButton.setSize(100, 20); listButton.setLocation(270, 450); container.add(listButton); resultText = new JTextArea(); resultText.setFont(new Font("맑은고딕", Font.PLAIN, 15)); resultText.setSize(300, 400); resultText.setLocation(500, 100); resultText.setLineWrap(true); resultText.setEditable(false); container.add(resultText); setVisible(true); } } | cs |
'Java' 카테고리의 다른 글
[자바 Swing] 로또 LottoMain.java LottoUI.java Lotto.java (0) | 2020.04.30 |
---|---|
[자바 객체지향] 인터페이스 활용한 가위바위보 게임 Rps.java (0) | 2020.04.30 |
[자바 객체지향] 인터페이스 예제 Bank.java (0) | 2020.04.30 |
[자바 알고리즘] 행렬을 이용한 풀이 Lotto.java (0) | 2020.04.30 |
19. 회원관리 Swing 앱 :: MemberSwing.java (0) | 2020.04.10 |