public JDialogDateSelector(JFrame parent) { super(parent, "title", true);  setSize(220, 270);  Calendar cal = Calendar.getInstance(); currentDate = new Date(); cal.setTime(currentDate);  Container cp = getContentPane(); cp.setLayout(new BorderLayout(0, 5));  jPanelContent = new JPanel() { public Insets getInsets() { return new Insets(5, 5, 5, 5); } }; jPanelContent.setLayout(new BorderLayout(0, 5)); cp.add(jPanelContent, BorderLayout.CENTER);  JPanel jPanelTop = new JPanel(); jPanelTop.setLayout(new BoxLayout(jPanelTop, BoxLayout.X_AXIS)); jComboBoxMonth = new JComboBox(); jComboBoxMonth.setFont(new Font("Dialog", Font.PLAIN, 12)); jComboBoxMonth.setMinimumSize(new Dimension(23, 24)); jComboBoxMonth.setPreferredSize(new Dimension(1000, 24)); jComboBoxMonth.setMaximumSize(new Dimension(1000, 24)); DateFormatSymbols dfs = new DateFormatSymbols(Util.locale); String[] months = dfs.getMonths(); for (int i = 0; i < months.length - 1; i++) jComboBoxMonth.addItem(Util.capitalize(months[i])); int iMonth = cal.get( Calendar.MONTH ); jComboBoxMonth.setSelectedIndex(iMonth);  SpinnerDateModel model = new SpinnerDateModel(); jSpinnerYear = new JSpinner(model); JSpinner.DateEditor editor = new JSpinner.DateEditor(jSpinnerYear, "yyyy"); jSpinnerYear.setEditor(editor); editor.getTextField().setEditable(false); model.setValue(currentDate); jSpinnerYear.setMinimumSize(new Dimension(23, 24)); jSpinnerYear.setPreferredSize(new Dimension(1000, 24)); jSpinnerYear.setMaximumSize(new Dimension(1000, 24));  jPanelTop.add(jComboBoxMonth); jPanelTop.add(Box.createHorizontalStrut(5)); jPanelTop.add(jSpinnerYear); jPanelContent.add(jPanelTop, BorderLayout.NORTH);  calendar = new LightCalendar(this, false); jPanelContent.add(calendar, BorderLayout.CENTER);   jButtonOk = new JButton("OK"); jButtonOk.setFont(jComboBoxMonth.getFont()); jButtonCancel = new JButton("cancel"); jButtonCancel.setFont(jButtonOk.getFont()); jPanelButton = new JPanel(); jPanelButton.setLayout(new FlowLayout(FlowLayout.RIGHT)); jPanelButton.add(jButtonOk); jPanelButton.add(jButtonCancel); cp.add(jPanelButton, BorderLayout.SOUTH);  SymAction lSymAction = new SymAction(); jComboBoxMonth.addActionListener(lSymAction); jButtonOk.addActionListener(lSymAction); jButtonCancel.addActionListener(lSymAction);  SymChange lSymChange = new SymChange(); jSpinnerYear.addChangeListener(lSymChange);   ResourceBundle resBundle = ResourceBundle.getBundle("properties.JDialogDateSelectorRes", Util.locale); setTitle(" " + resBundle.getString("title")); jButtonCancel.setText(resBundle.getString("cancel"));
public JDialogDateSelector(Frame parent) { this(parent, new Date());
    public JDialogDateSelector(JFrame parent) {        super(parent, "title", true);        setSize(220, 270);        Calendar cal = Calendar.getInstance();        currentDate = new Date();        cal.setTime(currentDate);        Container cp = getContentPane();        cp.setLayout(new BorderLayout(0, 5));        jPanelContent = new JPanel() {            public Insets getInsets() {                return new Insets(5, 5, 5, 5);            }        };        jPanelContent.setLayout(new BorderLayout(0, 5));        cp.add(jPanelContent, BorderLayout.CENTER);        JPanel jPanelTop = new JPanel();        jPanelTop.setLayout(new BoxLayout(jPanelTop, BoxLayout.X_AXIS));        jComboBoxMonth = new JComboBox();        jComboBoxMonth.setFont(new Font("Dialog", Font.PLAIN, 12));        jComboBoxMonth.setMinimumSize(new Dimension(23, 24));        jComboBoxMonth.setPreferredSize(new Dimension(1000, 24));        jComboBoxMonth.setMaximumSize(new Dimension(1000, 24));        DateFormatSymbols dfs = new DateFormatSymbols(Util.locale);        String[] months = dfs.getMonths();        for (int i = 0; i < months.length - 1; i++)            jComboBoxMonth.addItem(Util.capitalize(months[i]));        int iMonth = cal.get( Calendar.MONTH );        jComboBoxMonth.setSelectedIndex(iMonth);        SpinnerDateModel model = new SpinnerDateModel();        jSpinnerYear = new JSpinner(model);        JSpinner.DateEditor editor = new JSpinner.DateEditor(jSpinnerYear, "yyyy");        jSpinnerYear.setEditor(editor);        editor.getTextField().setEditable(false);        model.setValue(currentDate);        jSpinnerYear.setMinimumSize(new Dimension(23, 24));        jSpinnerYear.setPreferredSize(new Dimension(1000, 24));        jSpinnerYear.setMaximumSize(new Dimension(1000, 24));        jPanelTop.add(jComboBoxMonth);        jPanelTop.add(Box.createHorizontalStrut(5));        jPanelTop.add(jSpinnerYear);        jPanelContent.add(jPanelTop, BorderLayout.NORTH);        calendar = new LightCalendar(this, false);        jPanelContent.add(calendar, BorderLayout.CENTER);        jButtonOk = new JButton("OK");        jButtonOk.setFont(jComboBoxMonth.getFont());        jButtonCancel = new JButton("cancel");        jButtonCancel.setFont(jButtonOk.getFont());        jPanelButton = new JPanel();        jPanelButton.setLayout(new FlowLayout(FlowLayout.RIGHT));        jPanelButton.add(jButtonOk);        jPanelButton.add(jButtonCancel);        cp.add(jPanelButton, BorderLayout.SOUTH);        SymAction lSymAction = new SymAction();        jComboBoxMonth.addActionListener(lSymAction);        jButtonOk.addActionListener(lSymAction);        jButtonCancel.addActionListener(lSymAction);        SymChange lSymChange = new SymChange();        jSpinnerYear.addChangeListener(lSymChange);        //Localization        ResourceBundle resBundle = ResourceBundle.getBundle("properties.JDialogDateSelectorRes", Util.locale);        setTitle(" " + resBundle.getString("title"));        jButtonCancel.setText(resBundle.getString("cancel"));    }