use of jgnash.ui.components.SecurityComboBox in project jgnash by ccavanaugh.
the class SecurityHighLowChart method createPanel.
private JPanel createPanel() {
combo = new SecurityComboBox();
// create an empty chart for panel construction
chartPanel = new ChartPanel(new JFreeChart(new XYPlot()));
FormLayout layout = new FormLayout("p, 4dlu:g", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.append(combo);
builder.nextLine();
builder.appendRelatedComponentsGapRow();
builder.nextLine();
builder.appendRow(RowSpec.decode("fill:p:g"));
builder.append(chartPanel, 2);
combo.addActionListener(e -> updateChart());
return builder.getPanel();
}
use of jgnash.ui.components.SecurityComboBox in project jgnash by ccavanaugh.
the class SecuritiesHistoryDialog method initComponents.
private void initComponents() {
dateField = new DatePanel();
closeField = new JFloatField();
lowField = new JFloatField();
highField = new JFloatField();
securityCombo = new SecurityComboBox();
volumeField = new JIntegerField();
updateButton = new JButton(rb.getString("Button.UpdateOnline"), IconUtils.getIcon("/jgnash/resource/applications-internet.png"));
deleteButton = new JButton(rb.getString("Button.Delete"));
clearButton = new JButton(rb.getString("Button.Clear"));
applyButton = new JButton(rb.getString("Button.Add"));
closeButton = new JButton(rb.getString("Button.Close"));
model = new HistoryModel();
table = new HistoryTable();
table.setModel(model);
table.setPreferredScrollableViewportSize(new Dimension(150, 120));
table.setCellSelectionEnabled(false);
table.setColumnSelectionAllowed(false);
table.setRowSelectionAllowed(true);
table.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.setRowSorter(new TableRowSorter<>(model));
table.setFillsViewportHeight(true);
// create an empty chart for panel construction
chartPanel = new ChartPanel(new JFreeChart(new XYPlot()));
chartPanel.setPreferredSize(new Dimension(150, 90));
applyButton.addActionListener(this);
clearButton.addActionListener(this);
deleteButton.addActionListener(this);
updateButton.addActionListener(this);
securityCombo.addActionListener(this);
closeButton.addActionListener(this);
}
Aggregations