-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPLen.java
More file actions
54 lines (41 loc) · 1.52 KB
/
PLen.java
File metadata and controls
54 lines (41 loc) · 1.52 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
43
44
45
46
47
48
49
50
51
52
53
54
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class PLen {
public PLen() {
// Create the frame
JFrame frame = new JFrame("Homework Tracker");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(600, 400);
frame.setLayout(new BorderLayout());
// Create a panel for buttons
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
// Create buttons
JButton addButton = new JButton("Add Assignment");
JButton button2 = new JButton("Button 2");
JButton button3 = new JButton("Button 3");
addButton.setLocation(50, 80);
button2.setBounds(50,900,80, 100);
button3.setBounds(50,900,80, 100);
// Add buttons to the panel
buttonPanel.add(addButton);
buttonPanel.add(button2);
buttonPanel.add(button3);
frame.getContentPane().add(buttonPanel);
// Add action listener for the first button
// addButton.addActionListener(e -> addAssignment());
// Set frame visibility
frame.setVisible(true);
}
// private void addAssignment() {
// String title = JOptionPane.showInputDialog("Enter Assignment Title:");
// if (title != null && !title.trim().isEmpty()) {
// listModel.addElement(title);
// }
// }
public static void main(String[] args) {
SwingUtilities.invokeLater(PLen::new);
}
}