Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- @SuppressWarnings("serial")
- public class YewsGUI extends JFrame {
- private Main ctx;
- public YewsGUI(Main main) {
- getContentPane().setBackground(Color.LIGHT_GRAY);
- setForeground(Color.LIGHT_GRAY);
- getContentPane().setBackground(SystemColor.activeCaption);
- getContentPane().setForeground(Color.LIGHT_GRAY);
- this.ctx = main;
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- // if button is clicked this will be activated
- ctx.setStartScript(true);
- this.setVisible(false);
- }
- private void initComponents() {
- comboBox1 = new JComboBox<>();
- comboBox1.setBounds(10, 46, 136, 75);
- // ======== this ========
- setTitle("GE Yews");
- // ---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
- "Free2Play", "Member", }));
- JLabel lblNewLabel = new JLabel("Member or Free2Play?");
- lblNewLabel.setBounds(11, 13, 136, 34);
- getContentPane().setPreferredSize(new Dimension(300, 200));
- pack();
- setLocationRelativeTo(getOwner());
- getContentPane().setLayout(null);
- getContentPane().add(comboBox1);
- getContentPane().add(lblNewLabel);
- button1 = new JButton();
- button1.setBounds(159, 15, 81, 106);
- // ---- button1 ----
- button1.setText("Start");
- button1.addActionListener(e -> button1ActionPerformed(e));
- getContentPane().add(button1);
- }
- // a getter to acces this piece of information
- public String getway() {
- return comboBox1.getSelectedItem().toString();
- }
- private JButton button1;
- private JComboBox<String> comboBox1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement