Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JFrame;
- import javax.swing.JTextField;
- import javax.swing.JLabel;
- public class myFrame extends JFrame{
- public myFrame(){ // constructor
- super("Guess the number game");
- JLabel newLabel = new JLabel("I have a number between 0 and 1000. Can you guess my number?" + "\n" + "Please enter your first guess");
- this.add(newLabel);
- JTextField textField = new JTextField(4);
- this.add(textField);
- }
- public static void main(String[] args) {
- myFrame game = new myFrame();
- game.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement