use of jgnash.ui.components.FormattedJTable in project jgnash by ccavanaugh.
the class RecurringPanel method initComponents.
private void initComponents() {
JPanel toolPanel = new JPanel(new BorderLayout());
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
toolBar.setRollover(true);
newButton = new RollOverButton(rb.getString("Button.New"), IconUtils.getIcon("/jgnash/resource/document-new.png"));
modifyButton = new RollOverButton(rb.getString("Button.Modify"), IconUtils.getIcon("/jgnash/resource/document-properties.png"));
deleteButton = new RollOverButton(rb.getString("Button.Delete"), IconUtils.getIcon("/jgnash/resource/edit-delete.png"));
remindersButton = new RollOverButton(rb.getString("Button.CheckReminders"), IconUtils.getIcon("/jgnash/resource/view-refresh.png"));
reminderTable = new FormattedJTable();
reminderTable.setAutoCreateRowSorter(true);
reminderTable.setFillsViewportHeight(true);
reminderTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
reminderTable.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(final KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DELETE) {
deleteReminder();
}
}
});
reminderTable.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
if (e.getClickCount() == 2) {
showModifyDialog();
}
}
});
setLayout(new BorderLayout());
toolBar.add(newButton);
toolBar.add(modifyButton);
toolBar.add(deleteButton);
toolBar.addSeparator();
toolBar.add(remindersButton);
toolPanel.add(toolBar, BorderLayout.NORTH);
toolPanel.add(new JSeparator(), BorderLayout.CENTER);
add(toolPanel, java.awt.BorderLayout.NORTH);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0)));
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setAutoscrolls(true);
scrollPane.setViewportView(reminderTable);
add(scrollPane, java.awt.BorderLayout.CENTER);
deleteButton.addActionListener(this);
modifyButton.addActionListener(this);
newButton.addActionListener(this);
remindersButton.addActionListener(this);
}
use of jgnash.ui.components.FormattedJTable in project jgnash by ccavanaugh.
the class NotificationDialog method layoutMainPanel.
private void layoutMainPanel() {
FormLayout layout = new FormLayout("right:p, 4dlu, fill:p:g", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.border(Borders.DIALOG);
cancelButton = new JButton(rb.getString("Button.RemindLater"));
okButton = new JButton(rb.getString("Button.AckSel"));
table = new FormattedJTable(model);
table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.getSelectionModel().addListSelectionListener(this);
table.setColumnSelectionAllowed(false);
JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setAutoscrolls(true);
builder.appendRow(RowSpec.decode("fill:80dlu:g"));
builder.append(scrollPane, 3);
builder.nextLine();
builder.appendUnrelatedComponentsGapRow();
builder.nextLine();
builder.append(rb.getString("Label.RemindLater"), periodCombo);
builder.nextLine();
builder.appendRelatedComponentsGapRow();
builder.nextLine();
builder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton), 3);
getContentPane().add(builder.getPanel());
pack();
setMinimumSize(getSize());
}
use of jgnash.ui.components.FormattedJTable in project jgnash by ccavanaugh.
the class TransactionListDialog method initComponents.
private void initComponents() {
setTitle(rb.getString("Title.TransactionList"));
selectButton = new JButton(rb.getString("Button.SelectAll"));
clearButton = new JButton(rb.getString("Button.ClearAll"));
invertButton = new JButton(rb.getString("Button.InvertSelection"));
okButton = new JButton(rb.getString("Button.Ok"));
cancelButton = new JButton(rb.getString("Button.Cancel"));
model = new Model(_getPrintableTransactions());
table = new FormattedJTable(model);
table.getSelectionModel().addListSelectionListener(this);
cancelButton.addActionListener(this);
okButton.addActionListener(this);
selectButton.addActionListener(this);
clearButton.addActionListener(this);
invertButton.addActionListener(this);
}
Aggregations