Example #1
0
    @Override
    public void actionPerformed(ActionEvent e) {

      String[] addressArray = protocollo.getAddressMemory();
      final ViewDialogPen dialog = new ViewDialogPen(view, "Nuova penna", addressArray);
      dialog.addWindowListener(
          new WindowAdapter() {

            @Override
            public void windowClosed(WindowEvent e) {
              if (dialog.option == ViewDialogPen.OPTION.OK) {
                Controller.this.addNewPen(dialog.getPen());
              }
            }
          });
    }
Example #2
0
    @Override
    public void actionPerformed(ActionEvent e) {
      String[] addressArray = protocollo.getAddressMemory();
      final int indexPen = view.getIndexSelectedListPens();

      final ViewDialogPen dialog =
          new ViewDialogPen(view, "Modifica penna", addressArray, pens[indexPen]);

      dialog.addWindowListener(
          new WindowAdapter() {

            @Override
            public void windowClosed(WindowEvent e) {
              if (dialog.option == ViewDialogPen.OPTION.OK) {
                Controller.this.updatePen(dialog.getPen(), indexPen);
              }
            }
          });
    }