use of java.text.DateFormatSymbols in project processdash by dtuma.
the class TimeCardDialog method buildTopPanel.
private Component buildTopPanel() {
Box result = Box.createHorizontalBox();
result.add(new JLabel(resources.getString("Time_Card.Month_Label") + " "));
// We have to build our own month name array because the "official"
// one contains 13 month names, the last one empty for Gregorian
// Calendars
String[] monthNames = new String[12];
String[] officialMonthNames = (new DateFormatSymbols()).getMonths();
for (int i = 12; i-- > 0; ) monthNames[i] = officialMonthNames[i];
monthField = new JComboBox(monthNames);
dontGrow(monthField);
monthField.setSelectedIndex(model.getMonth() - Calendar.JANUARY);
monthField.setMaximumRowCount(12);
result.add(monthField);
monthField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
recalc();
}
});
yearField = new JTextField(5);
dontGrow(yearField);
yearField.setText(Integer.toString(model.getYear()));
result.add(yearField);
yearField.getDocument().addDocumentListener(new DocumentListener() {
public void insertUpdate(DocumentEvent e) {
recalc();
}
public void removeUpdate(DocumentEvent e) {
recalc();
}
public void changedUpdate(DocumentEvent e) {
recalc();
}
});
result.add(Box.createHorizontalGlue());
result.add(new JLabel(resources.getString("Time_Format.Label") + " "));
formatType = new JComboBox();
formatType.addItem(format(75, HOURS_MINUTES));
formatType.addItem(format(75, HOURS));
formatType.addItem(format(75, MINUTES));
dontGrow(formatType);
result.add(formatType);
formatType.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
redraw();
}
});
result.add(Box.createHorizontalGlue());
hideColumns = new JCheckBox();
result.add(new JLabel(" " + resources.getString("Time_Card.Hide_Empty_Columns_Label") + " "));
result.add(hideColumns);
hideColumns.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
resizeColumns();
}
});
result.add(Box.createHorizontalGlue());
JButton closeButton = new JButton(resources.getString("Close"));
dontGrow(closeButton);
result.add(Box.createVerticalStrut(closeButton.getPreferredSize().height + 4));
result.add(closeButton);
closeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.setVisible(false);
}
});
return result;
}
use of java.text.DateFormatSymbols in project processdash by dtuma.
the class TimeLogEditor method createWeekFilterStartDaySubmenu.
private JMenuItem createWeekFilterStartDaySubmenu() {
int filterStartDay = getWeekFilterStartDay(Calendar.getInstance());
String[] dayNames = new DateFormatSymbols().getWeekdays();
JMenu submenu = new JMenu();
for (int day = 1; day <= 7; day++) submenu.add(new WeekFilterStartDayOption(submenu, dayNames, day, filterStartDay));
submenu.setFont(submenu.getFont().deriveFont(submenu.getFont().getSize2D() * 0.8f));
return submenu;
}
Aggregations