repl.it
@AmirBayramaliev/

MyJavaSwingExperiments-1

Java Swing

No description

fork
loading
Files
  • Main.java
  • Content.class
  • Main.class
  • nohup.out
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
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class Content extends JPanel {


  public Content() {
    JButton button = new JButton("Hello");
    add(button);
  }

}

class Main {
  public static void createGUI() {
    JFrame frame = new JFrame("My First GUI");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400, 400);
    frame.setVisible(true);

    Content content = new Content();

    frame.setContentPane(content);
  }
 
  public static void main(String[] args) {
    createGUI();
  }
}
Fetching token
?