changeset 84:0be27b125634

TabCalendarBoard: Started on date range selection
author Fox
date Wed, 25 Jan 2023 05:29:33 +0100
parents 8759379a27a4
children 9eb88ddd4e94
files src/junotu/TabCalendarBoard.java
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/junotu/TabCalendarBoard.java	Sun Jan 22 05:35:59 2023 +0100
+++ b/src/junotu/TabCalendarBoard.java	Wed Jan 25 05:29:33 2023 +0100
@@ -21,6 +21,7 @@
 import javax.swing.SwingUtilities;
 import javax.swing.event.DocumentListener;
 import javax.swing.event.DocumentEvent;
+import javax.swing.SpinnerDateModel;
 
 import javax.swing.JPanel;
 import javax.swing.Box;
@@ -31,6 +32,7 @@
 
 import java.awt.Component;
 import javax.swing.JButton;
+import javax.swing.JSpinner;
 import javax.swing.JLabel;
 import javax.swing.JTextArea;
 import javax.swing.JTextField;
@@ -481,22 +483,33 @@
     boolean optionOnlyFilledColumns;
 
     JButton back;
+    JSpinner dateRangeBegin;
+    JSpinner dateRangeEnd;
 
     public TabCalendarBoard()
     {
 	this.setLayout( new BorderLayout() );
 
 	back = new JButton("Back");
-	
+	dateRangeBegin = new JSpinner( new SpinnerDateModel() );
+	dateRangeEnd = new JSpinner( new SpinnerDateModel() );
+	JSpinner.DateEditor dateRangeBeginEditor = (JSpinner.DateEditor)dateRangeBegin.getEditor();
+	JSpinner.DateEditor dateRangeEndEditor = (JSpinner.DateEditor)dateRangeEnd.getEditor();
+	    
 	Box bottom = Box.createHorizontalBox();
 	columns = Box.createHorizontalBox();
 	scroll = new JScrollPane( columns );
 	
 	bottom.add( back );
 	bottom.add( Box.createHorizontalGlue() );
+	bottom.add( dateRangeBegin );
+	bottom.add( dateRangeEnd );
 	this.add( scroll, BorderLayout.CENTER );
 	this.add( bottom, BorderLayout.SOUTH );
 
+	dateRangeBeginEditor.getFormat().applyPattern("yyyy-MM-dd EEEE");
+	dateRangeEndEditor.getFormat().applyPattern("yyyy-MM-dd EEEE");
+
 	back.addActionListener(this);
 
 	back.setToolTipText("Go back to where the calendar board was accessed from.");