Skip to content
Snippets Groups Projects
Commit d8946c69 authored by Ondřej Hrdlička's avatar Ondřej Hrdlička
Browse files

Added WelcomePanel, containing helpful startup text

parent 0c2b893d
No related branches found
No related tags found
2 merge requests!52Final project MR,!45Activating most of the app
package cz.muni.fi.pv168.project.ui.main.panel;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
public class WelcomePanel {
private final JPanel panel;
private static final String WELCOME_MESSAGE =
"Welcome to to:do, your daily task reminder.\n" + "\n" +
"You can use the toolbar buttons above to add, edit, or delete tasks and categories.\n" +
"Switch between tasks and categories using the tabs.\n" +
"Click on a task in the list on the left to see details.";
public WelcomePanel() {
var welcomeTextArea = new JTextArea(WELCOME_MESSAGE);
welcomeTextArea.setFont(new Font(Font.SANS_SERIF, welcomeTextArea.getFont().getStyle(), 20));
welcomeTextArea.setLineWrap(true);
welcomeTextArea.setWrapStyleWord(true);
welcomeTextArea.setEditable(false);
panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createCompoundBorder(new EtchedBorder(EtchedBorder.LOWERED), new EmptyBorder(50, 50, 50, 50)));
welcomeTextArea.setBackground(new Color(panel.getBackground().getRGB()));
panel.add(welcomeTextArea);
}
public JPanel getPanel() {
return panel;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment