| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package gui.panels.agenda;
- import java.awt.Color;
- import java.awt.FlowLayout;
- import java.awt.Font;
- import java.util.Calendar;
- import java.util.GregorianCalendar;
- import javax.swing.ImageIcon;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- @SuppressWarnings("serial")
- public class DaySelectorPane extends JPanel{
- private JLabel buttonLeft, buttonRight;
- private JLabel dateLabel;
-
- public DaySelectorPane(){
- this.setLayout(new FlowLayout());
- addContent();
- this.setOpaque(true);
- this.setBackground(Color.WHITE);
- }
-
- private void addContent(){
- buttonLeft = new JLabel();
- dateLabel = new JLabel();
- dateLabel.setFont(new Font("Arial", Font.PLAIN, 11));
- dateLabel.setForeground(new Color(51,51,51));
- buttonRight = new JLabel();
- buttonLeft.setIcon(new ImageIcon(getClass().getResource("/left.png")));
- buttonRight.setIcon(new ImageIcon(getClass().getResource("/right.png")));
- this.add(buttonLeft);
- this.add(dateLabel);
- this.add(buttonRight);
- }
-
- public void setDate(GregorianCalendar date){
- dateLabel.setText(date.get(Calendar.YEAR) + "-" + (date.get(Calendar.MONTH)+1) + "-" + date.get(Calendar.DATE));
- }
- public JLabel getButtonLeft() {
- return buttonLeft;
- }
- public JLabel getButtonRight() {
- return buttonRight;
- }
- }
|