Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Spiel;
- import java.awt.BorderLayout;
- import java.awt.Font;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- import javax.swing.JTextField;
- public class WaitforConnection {
- public GetRandomWord randomword;
- public Main m;
- public Console console;
- public Connection con;
- private JButton skip;
- private JTextField text;
- ActionListener actionListener = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == skip) {
- connbestaetigung();
- }
- }
- };
- private static JFrame frame;
- public void show() {
- Font font = new Font("Calibri", Font.BOLD, 20);
- // create main frame
- frame = new JFrame("Warte auf verbindung");
- frame.setSize(300, 300);
- frame.getContentPane().setLayout(new BorderLayout());
- skip = new JButton("Γberspringen");
- frame.add(skip,BorderLayout.PAGE_END);
- skip.addActionListener(actionListener);
- text = new JTextField();
- text.setText("Warte auf Verbindung...");
- text.setFont(font);
- text.setEditable(false);
- frame.add(text,BorderLayout.PAGE_START);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- }
- public void connbestaetigung(){
- try {frame.dispose();frame = null;} catch (Exception e) {}
- MyPanel mp = new MyPanel();
- String random = randomword.getRandomWord();
- JOptionPane.showMessageDialog(frame, "Bitte male "+random);
- con.serversendMessage("start rate "+random);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement