Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132939 views
License: OTHER
1
import javax.swing.JButton;
2
import javax.swing.JFrame;
3
import javax.swing.JLabel;
4
import javax.swing.JPanel;
5
6
public class Main {
7
public static void main(String[] args) {
8
JFrame frame = new JFrame("My title!");
9
frame.setVisible(true);
10
frame.setSize(300, 150);
11
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
12
13
JPanel panel = new JPanel();
14
frame.add(panel);
15
16
JLabel label = new JLabel("my label");
17
panel.add(label);
18
19
JButton button = new JButton("my button");
20
panel.add(button);
21
}
22
}
23
24