protected void newButton_actionPerformed(ActionEvent e) { try { ApplicationSystem.getInstance().execute(NewGrestCommand.createCommand()); } catch (CommandExecutionException e1) { ApplicationSystem.getInstance().showWarning("Cannot create grest.", this); } }
protected void importButton_actionPerformed(ActionEvent e) { try { ApplicationSystem.getInstance().execute(ImportGrestCommand.createCommand()); } catch (CommandExecutionException e1) { ApplicationSystem.getInstance().showWarning("Cannot import the specified grest.", this); } }
protected void openButton_actionPerformed(ActionEvent e) { try { ApplicationSystem.getInstance() .execute(OpenGrestCommand.createCommand(grestsList.getSelectedGrest())); } catch (CommandExecutionException e1) { ApplicationSystem.getInstance().showWarning("Cannot open the selected grest.", this); } }
protected void removeMenuItem_actionPerformed(ActionEvent e) { try { ApplicationSystem.getInstance() .execute(RemoveGrestCommand.createCommand(grestsList.getSelectedGrest(), this)); } catch (CommandExecutionException e1) { ApplicationSystem.getInstance().showWarning("Cannot remove the selected grest.", this); } }
public static void main(String[] args) { ApplicationSystem.initialize(new String[0]); GrestsManager.getInstance(); SwingUtilities.invokeLater( new Runnable() { public void run() { JFrame f = new JFrame("Grests List"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(new GrestsListPanel()); f.pack(); f.setVisible(true); } }); }