import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class MyFrameTest extends JFrame {
public MyFrameTest() {
Toolkit kit = Toolkit.getDefaultToolkit();
Image icon = kit.getImage("Occupations-Pizza-Deliveryman-Female-Light-icon.png");
setIconImage(icon);
JLabel lblText = new JLabel("자바피자에 오신것을 환영합니다. 피자를 고르세요", JLabel.CENTER);
JPanel pan = new JPanel(new FlowLayout());
JButton combo = new JButton("콤보피자");
JButton potato = new JButton("포테이토피자");
JButton bulgogi = new JButton("불고기피자");
pan.add(combo);
pan.add(potato);
pan.add(bulgogi);
add(lblText, BorderLayout.CENTER);
add(pan, BorderLayout.SOUTH);
setTitle("MyFrame");
pack();
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) {
new MyFrameTest();
}
}