1import javax.swing.*;
2class gui{
3 public static void main(String args[]){
4 JFrame frame = new JFrame("My First GUI");
5 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
6 frame.setSize(300,300);
7 JButton button = new JButton("Click me");
8 frame.getContentPane().add(button); // Adds Button to content pane of frame
9 frame.setVisible(true);
10 }
11}
12
1import java.util.UUID;
2
3public class RandomStringUUID {
4 public static void main(String[] args) {
5 // Creating a random UUID (Universally unique identifier).
6 UUID uuid = UUID.randomUUID();
7 String randomUUIDString = uuid.toString();
8
9 System.out.println("Random UUID String = " + randomUUIDString);
10 System.out.println("UUID version = " + uuid.version());
11 System.out.println("UUID variant = " + uuid.variant());
12 }
13}
14
1import javax.swing.*;
2class main {
3 public static void main(String args[]){
4 JFrame frame = new JFrame("Hello World");
5 frame.setSize(300,300)
6 JButton button = new JButton("You should totally click me");
7 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
8 frame.getContentPane().add(button); // Adds Button to content pane of frame
9 frame.setVisible(true);
10 }
11}
1import javax.swing.*;
2
3public class Main {
4 public static void main(String []args) {
5
6 JFrame framing = new JFrame();
7 framing.setPSize
8 framing.setExtendedState()