-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome.java
More file actions
28 lines (22 loc) · 837 Bytes
/
Copy pathwelcome.java
File metadata and controls
28 lines (22 loc) · 837 Bytes
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
package shamitha;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class WelcomeApp {
public static void main(String[] args) {
JFrame frame = new JFrame("Welcome App");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 200);
frame.setLayout(new FlowLayout());
JButton button = new JButton("Click Me");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(frame, "Welcome to the Java GUI Application!", "Welcome", JOptionPane.INFORMATION_MESSAGE);
}
});
frame.add(button);
frame.setVisible(true);
}
}