본문내용
sult);
ResultText.setText(Str);
}
else if(ToppingP.Pepperoni.isSelected()){
Result = 17500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Bacon.isSelected()){
Result = 19000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
}
else if(SizeP.Medium.isSelected()){
if(ToppingP.SweetPepper.isSelected()){
Result = 17000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Cheese.isSelected()){
Result = 22500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Pepperoni.isSelected()){
Result = 19500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Bacon.isSelected()){
Result = 21000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
}
else if(SizeP.Large.isSelected()){
if(ToppingP.SweetPepper.isSelected()){
Result = 19000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Cheese.isSelected()){
Result = 24500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Pepperoni.isSelected()){
Result = 21500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Bacon.isSelected()){
Result = 23000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
}
}
// 취소
else if(e.getSource() == Cancel){
System.exit(0);
}
}
}
class WelcomePanel extends JPanel {
private JLabel Message;
public WelcomePanel(){
Message = new JLabel("자파 피자에 오신것을 환영합니다.");
Message.setForeground(Color.BLUE);
add(Message);
}
}
class TypePanel extends JPanel {
public JRadioButton Combo, Potato, Bulgogi;
public TypePanel(){
setLayout(new GridLayout(3,1));
Combo = new JRadioButton("콤보", true);
Potato = new JRadioButton("포테이토", false);
Bulgogi = new JRadioButton("불고기", false);
ButtonGroup Bg = new ButtonGroup();
Bg.add(Combo);
Bg.add(Potato);
Bg.add(Bulgogi);
setBorder(BorderFactory.createTitledBorder("종류"));
add(Combo);
add(Potato);
add(Bulgogi);
}
}
class ToppingPanel extends JPanel {
public JRadioButton SweetPepper, Cheese, Pepperoni, Bacon;
public ToppingPanel(){
setLayout(new GridLayout(4,1));
SweetPepper = new JRadioButton("피망", true);
Cheese = new JRadioButton("치즈", false);
Pepperoni = new JRadioButton("페페로니", false);
Bacon = new JRadioButton("베이컨", false);
ButtonGroup Bg = new ButtonGroup();
Bg.add(SweetPepper);
Bg.add(Cheese);
Bg.add(Pepperoni);
Bg.add(Bacon);
setBorder(BorderFactory.createTitledBorder("추가 토핑"));
add(SweetPepper);
add(Cheese);
add(Pepperoni);
add(Bacon);
}
}
class SizePanel extends JPanel {
public JRadioButton Small, Medium, Large;
public SizePanel(){
setLayout(new GridLayout(3,1));
Small = new JRadioButton("Small", false);
Medium = new JRadioButton("Medium", true);
Large = new JRadioButton("Large", false);
ButtonGroup Bg = new ButtonGroup();
Bg.add(Small);
Bg.add(Medium);
Bg.add(Large);
setBorder(BorderFactory.createTitledBorder("크기"));
add(Small);
add(Medium);
add(Large);
}
}
public class PizzaMenuTest {
public static void main(String[] args) {
PizzaMenu Menu = new PizzaMenu("피자 주문");
}
}
ResultText.setText(Str);
}
else if(ToppingP.Pepperoni.isSelected()){
Result = 17500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Bacon.isSelected()){
Result = 19000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
}
else if(SizeP.Medium.isSelected()){
if(ToppingP.SweetPepper.isSelected()){
Result = 17000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Cheese.isSelected()){
Result = 22500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Pepperoni.isSelected()){
Result = 19500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Bacon.isSelected()){
Result = 21000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
}
else if(SizeP.Large.isSelected()){
if(ToppingP.SweetPepper.isSelected()){
Result = 19000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Cheese.isSelected()){
Result = 24500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Pepperoni.isSelected()){
Result = 21500;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
else if(ToppingP.Bacon.isSelected()){
Result = 23000;
Str = String.valueOf(Result);
ResultText.setText(Str);
}
}
}
// 취소
else if(e.getSource() == Cancel){
System.exit(0);
}
}
}
class WelcomePanel extends JPanel {
private JLabel Message;
public WelcomePanel(){
Message = new JLabel("자파 피자에 오신것을 환영합니다.");
Message.setForeground(Color.BLUE);
add(Message);
}
}
class TypePanel extends JPanel {
public JRadioButton Combo, Potato, Bulgogi;
public TypePanel(){
setLayout(new GridLayout(3,1));
Combo = new JRadioButton("콤보", true);
Potato = new JRadioButton("포테이토", false);
Bulgogi = new JRadioButton("불고기", false);
ButtonGroup Bg = new ButtonGroup();
Bg.add(Combo);
Bg.add(Potato);
Bg.add(Bulgogi);
setBorder(BorderFactory.createTitledBorder("종류"));
add(Combo);
add(Potato);
add(Bulgogi);
}
}
class ToppingPanel extends JPanel {
public JRadioButton SweetPepper, Cheese, Pepperoni, Bacon;
public ToppingPanel(){
setLayout(new GridLayout(4,1));
SweetPepper = new JRadioButton("피망", true);
Cheese = new JRadioButton("치즈", false);
Pepperoni = new JRadioButton("페페로니", false);
Bacon = new JRadioButton("베이컨", false);
ButtonGroup Bg = new ButtonGroup();
Bg.add(SweetPepper);
Bg.add(Cheese);
Bg.add(Pepperoni);
Bg.add(Bacon);
setBorder(BorderFactory.createTitledBorder("추가 토핑"));
add(SweetPepper);
add(Cheese);
add(Pepperoni);
add(Bacon);
}
}
class SizePanel extends JPanel {
public JRadioButton Small, Medium, Large;
public SizePanel(){
setLayout(new GridLayout(3,1));
Small = new JRadioButton("Small", false);
Medium = new JRadioButton("Medium", true);
Large = new JRadioButton("Large", false);
ButtonGroup Bg = new ButtonGroup();
Bg.add(Small);
Bg.add(Medium);
Bg.add(Large);
setBorder(BorderFactory.createTitledBorder("크기"));
add(Small);
add(Medium);
add(Large);
}
}
public class PizzaMenuTest {
public static void main(String[] args) {
PizzaMenu Menu = new PizzaMenu("피자 주문");
}
}
소개글