use of jgnash.ui.components.JDateField in project jgnash by ccavanaugh.
the class ProfitLossTXT method getDates.
private LocalDate[] getDates() {
final LocalDate start = LocalDate.now().minusYears(1);
final JDateField startField = new JDateField();
final JDateField endField = new JDateField();
startField.setValue(start);
final FormLayout layout = new FormLayout("right:p, 4dlu, p:g", "");
final DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.rowGroupingEnabled(true);
builder.append(rb.getString("Label.StartDate"), startField);
builder.append(rb.getString("Label.EndDate"), endField);
builder.nextLine();
builder.appendUnrelatedComponentsGapRow();
builder.nextLine();
final JPanel panel = builder.getPanel();
int option = JOptionPane.showConfirmDialog(null, new Object[] { panel }, rb.getString("Message.StartEndDate"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
if (option == JOptionPane.OK_OPTION) {
return new LocalDate[] { startField.localDateValue(), endField.localDateValue() };
}
return null;
}
use of jgnash.ui.components.JDateField in project jgnash by ccavanaugh.
the class RecurringEntryDialog method createEntryPanel.
private JPanel createEntryPanel() {
FormLayout layout = new FormLayout("right:p, 4dlu, 45dlu", "f:p, 3dlu, f:p");
CellConstraints cc = new CellConstraints();
JPanel p = new JPanel(layout);
autoEnterCheckBox = new JCheckBox(rb.getString("Button.EnterDaysBefore"));
daysBeforeField = new JIntegerField();
lastOccurrenceField = new JDateField();
p.add(autoEnterCheckBox, cc.xy(1, 1));
p.add(daysBeforeField, cc.xy(3, 1));
p.add(new JLabel(rb.getString("Label.LastOccurrence")), cc.xy(1, 3));
p.add(lastOccurrenceField, cc.xy(3, 3));
// clear the date
lastOccurrenceField.setValue(null);
lastOccurrenceField.setEditable(false);
return p;
}
Aggregations