danniellee / KNU-20192-08

using java to make account book
0 stars 0 forks source link

행사 기준 설정 GUI #7

Open Kim-Dong-Ju opened 4 years ago

Kim-Dong-Ju commented 4 years ago

import javax.swing.; import java.awt.; import java.awt.event.*;

public class Event2 extends JFrame implements ActionListener {

 public static final int WIDTH = 1300;
 public static final int HEIGHT = 1000;

 public Event2( )
    {
        setTitle("standard registration");
        setSize(WIDTH, HEIGHT);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        setLayout(new BorderLayout());

        JPanel panel1_u = new JPanel();
        JPanel panel1 = new JPanel();
        JPanel panel2 = new JPanel();
        JPanel panel3 = new JPanel();
        JPanel panel3_u = new JPanel();
        JPanel flow = new JPanel();
        panel1.setLayout(new GridLayout(3,1,0,0));
        panel1_u.setLayout(new FlowLayout());
        panel2.setLayout(new GridLayout(2,1,0,0));
        panel3_u.setLayout(new GridLayout(2,1));
        panel3.setLayout(new FlowLayout());
        flow.setLayout(new GridLayout(2,1,20,0));

        //위쪽 테이블
        JLabel STANDARD_REGISTRATION = new JLabel("제품 판매율 입력 (~ 이하 할인)");
        STANDARD_REGISTRATION.setFont(new Font("Arial", Font.BOLD, 50));
        STANDARD_REGISTRATION.setPreferredSize(new Dimension(500,-3000));
        panel1.add(STANDARD_REGISTRATION); 

        JTextField sr = new JTextField(500);
        sr.setFont(new Font("Arial",Font.PLAIN, 20));
        panel1.add(sr);

        JButton srb = new JButton("기준 설정");
        srb.setPreferredSize(new Dimension(300,60));
        srb.setFont(new Font("Arial", Font.BOLD, 18));
        srb.addActionListener(this);
        panel1_u.add(srb);
        panel1.add(panel1_u);

        flow.add(panel1);

        //아래쪽 테이블
        JLabel Discount_product = new JLabel("조건에 맞는 상품");
        Discount_product.setFont(new Font("Arial", Font.BOLD, 50));
        Discount_product.setPreferredSize(new Dimension(500,-3000));
        panel2.add(Discount_product); 

        String header_down[]= {"행사 상품명","할인율","할인가"};
        String cells_down[][] = {{"egg","30%","350"}};
        JTable table_down = new JTable(cells_down,header_down);
        JScrollPane js2 = new JScrollPane(table_down);
        table_down.setRowHeight(30);
        table_down.setFont(new Font("Arial",Font.PLAIN, 20));
        panel2.add(js2);

        flow.add(panel2);

        add(flow,BorderLayout.CENTER);

        JButton standard = new JButton("행사 상품 등록");
        standard.setPreferredSize(new Dimension(300,60));
        standard.setFont(new Font("Arial", Font.BOLD, 18));
        standard.addActionListener(this);
        panel3.add(standard);
        panel3_u.add(panel3);
        add(panel3_u,BorderLayout.SOUTH);
    }
 public void actionPerformed(ActionEvent e)
    {

    }

}