/*
import javax.swing.*;
import java.awt.*;
public class Main extends JFrame {
public Main() {
setTitle("라디오 버튼 예제");
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new FlowLayout());
ImageIcon cherry = new ImageIcon("cherries");
ImageIcon okcherry = new ImageIcon("cherry");
ButtonGroup g = new ButtonGroup();
JRadioButton apple = new JRadioButton("사과",true);
JRadioButton pear = new JRadioButton("배");
JRadioButton chery = new JRadioButton("체리",cherry);
chery.setBorderPainted(true);
chery.setSelectedIcon(okcherry);
g.add(apple);
g.add(pear);
g.add(chery);
c.add(apple);
c.add(pear);
c.add(chery);
setSize(250,150);
setVisible(true);
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Main extends JFrame {
private JRadioButton [] radio = new JRadioButton [3];
private String [] text = {"사과","배","체리"};
private ImageIcon [] image = {
new ImageIcon("apple.png"),
new ImageIcon("banana.png"),
new ImageIcon("strawberry.png")
};
private JLabel imageLabel = new JLabel();
public Main() {
setTitle("뙇뀛뙭쮷헯쀏꽗뤓");
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new BorderLayout());
JPanel radioPanel = new JPanel();
radioPanel.setBackground(Color.gray);
ButtonGroup g = new ButtonGroup();
for(int i=0 ; i<radio.length ; i++) {
radio[i] = new JRadioButton();
g.add(radio[i]);
radioPanel.add(radio[i]);
radio[i].addItemListener(new MyItemListener());
}
radio[2].setSelected(true);
c.add(radioPanel,BorderLayout.NORTH);
c.add(imageLabel,BorderLayout.CENTER);
imageLabel.setHorizontalAlignment(SwingConstants.CENTER);
setSize(250,200);
setVisible(true);
}
class MyItemListener implements ItemListener {
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.DESELECTED) {
return;
}
if(radio[0].isSelected()) {
imageLabel.setIcon(image[0]);
}
else if(radio[1].isSelected()) {
imageLabel.setIcon(image[1]);
}
else {
imageLabel.setIcon(image[2]);
}
}
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
import javax.swing.*;
import java.awt.*;
public class Main extends JFrame {
public Main() {
setTitle("텏트 퓔드");
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new FlowLayout());
JTextField tf = new JTextField("홍길동",20);
JTextField tf1 = new JTextField("컴공",20);
JTextField tf2 = new JTextField("##도 ##시 ##군 ##구 ##동 ##읍 ##면 ##리",20);
c.add(new JLabel("이름 "));
c.add(tf);
c.add(new JLabel("학과 "));
c.add(tf1);
c.add(new JLabel("주소 "));
c.add(tf2);
tf.setFont(new Font("궁서체",Font.PLAIN,15));
tf1.setFont(new Font("궁서체",Font.PLAIN,15));
tf2.setFont(new Font("궁서체",Font.PLAIN,15));
setSize(245,150);
setVisible(true);
}
public static void main(String[] args) {
new Main();
}
}
*/
/*
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class Main extends JFrame {
private JTextField tf = new JTextField(20);
private JTextArea ta = new JTextArea(7,20);
public Main() {
setTitle("ㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁ");
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new FlowLayout());
c.add(new JLabel("입력후 <Enter>키를 입력하세요"));
c.add(tf);
c.add(new JScrollPane(ta));
tf.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JTextField t = (JTextField)e.getSource();
ta.append(t.getText()+"\n");
t.setText("");
}
});
setSize(300,200);
setVisible(true);
}
public static void main(String[] args) {
new Main();
}
}
*/



