repl.it
@Peanut123/

JFrame

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.awt.*; 
import javax.swing.*;


class Main{
  public static void main(String[] args){
    JFrame window = new JFrame("TITLE");
    window.setSize(500, 500);
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setVisible(true);
  }
}

class Main extends JFrame {
  public Main(String title) {
    super(title);
    setSize(500, 500);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
    //JLabel label = new JLabel("Hello World");
    //add(label);
    //JTestField text_field = new JTextField(10);
    //add(text_field);
    
    JButton button = new JButton("CLICK ME!");
    add(button);
    
    setVisible(true);
  }
  public static void main(String[] args) {
    new Main("This is my Window!");
  }
}
Fetching token
?