-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTitleBar.java
More file actions
21 lines (16 loc) · 762 Bytes
/
TitleBar.java
File metadata and controls
21 lines (16 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package classes;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class TitleBar extends JPanel{
// Constructor
public TitleBar(){
this.setPreferredSize(new Dimension(400,80)); // Set the preferred size for the title bar
JLabel titleText = new JLabel("To Do List"); // Create a label for the title text
titleText.setPreferredSize(new Dimension(200, 80)); // Set preferred zise for the label
titleText.setFont(new Font("Sans-Serif", Font.BOLD, 20)); // Set font for the label
titleText.setHorizontalAlignment(JLabel.CENTER); // Center align the text in the label
this.add(titleText); // Add the label to the panel
}
}