package view; import java.awt.*; import java.awt.event.*; import javax.swing.*; /**** * * Class SmallDayViewDisplay is a prototype of the day-size box in a monthly * agenda. The display is comprised of a vertical box containing a * left/top-justified JLabel with the date number, and a JList of scheduled * item descriptors. * * In the current prototype implementation, the JList is empty. In the * completed implementation, the JList will be hooked up with the * DefaultListModel that contains the scheduled item descriptors for a given * day. * */ public class SmallDayViewDisplay extends JPanel { /** * Construct this as vbox of date number and item-descriptor list. */ SmallDayViewDisplay(String dateString) { /* * Set this' layout to a vertical box. */ setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); /* * Create the date number label and attach its mouse listener. */ JLabel label = new JLabel(dateString); /* * Construct a (for now empty) list of items. */ JList list = new JList(); /* * Finish the layout. */ add(label); add(list); setBackground(Color.white); setBorder(BorderFactory.createLineBorder(Color.black)); } }