-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadApp.java
More file actions
42 lines (37 loc) · 1.27 KB
/
Copy pathLoadApp.java
File metadata and controls
42 lines (37 loc) · 1.27 KB
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
34
35
36
37
38
39
40
41
42
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class LoadApp {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
createAndShowGUI();
}
});
}
private static void createAndShowGUI() {
JFrame frame = new JFrame("Load To-Do List");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 200);
// Set the screenshot as the icon
ImageIcon icon = new ImageIcon("c:/Users/nelso/moss/screenshot.png");
frame.setIconImage(icon.getImage());
JButton openButton = new JButton("Open To-Do List");
openButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new ToDoListApp();
}
});
}
});
frame.setLayout(new BorderLayout());
frame.add(openButton, BorderLayout.CENTER);
frame.setVisible(true);
}
}