String choices[] = new String[] {"Keep Changes",
String[] choices = new String[] {"Keep Changes",
    public PatchEditorFrame(String name, Patch patch) {	super(name, true, true, true, true);	p = patch;	//make backup copy	System.arraycopy(p.sysex, 0, originalPatch, 0, p.sysex.length);	layout = new GridBagLayout();    gbc = new GridBagConstraints();	scrollPane = new JPanel();    scrollPane.setLayout(layout);	scrollPane.setSize(600, 400); 	scroller = new JScrollPane(scrollPane);    getContentPane().add(scroller);	setSize(600, 400);    scroller.getVerticalScrollBar().addMouseListener(new MouseAdapter() {		public void mousePressed(MouseEvent e) {		}            public void mouseReleased(MouseEvent e) {                    repaint();                }                    });    scroller.getHorizontalScrollBar().addMouseListener(new MouseAdapter() {		public void mousePressed(MouseEvent e) {		}            public void mouseReleased(MouseEvent e) {                    repaint();                }                    });    addInternalFrameListener(new InternalFrameListener() {		public void internalFrameClosing(InternalFrameEvent e) {		    String choices[] = new String[] {"Keep Changes",						     "Revert to Original",						     "Place Changed Version on Clipboard"		    };		    int choice = JOptionPane.CLOSED_OPTION;		    while (choice == JOptionPane.CLOSED_OPTION)			choice = JOptionPane.showOptionDialog((Component) null,							      "What do you wish to do with the changed copy of the Patch?",							      "Save Changes?",							      JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE,							      null, choices, choices[0]);		    if (choice == 0) {			if (bankFrame == null)                        return;			bankFrame.myModel.setPatchAt(p, patchRow, patchCol);			return;		    }		    if (choice == 2)			//put on clipboard but don't 'return' just yet			CopySelectedPatch(); 		    //restore backup		    System.arraycopy(originalPatch, 0, p.sysex, 0, p.sysex.length);                        }  	    		public void internalFrameOpened(InternalFrameEvent e) {		}		public void internalFrameActivated(InternalFrameEvent e) {		    ((Driver) (PatchEdit.getDriver(p.deviceNum, p.driverNum))).calculateChecksum(p);		    ((Driver) (PatchEdit.getDriver(p.deviceNum, p.driverNum))).sendPatch(p);               gotFocus();		    PatchEdit.receiveAction.setEnabled(false);		    PatchEdit.pasteAction.setEnabled(false);		    PatchEdit.sendAction.setEnabled(true);		    PatchEdit.sendToAction.setEnabled(true);		    PatchEdit.playAction.setEnabled(true);		    PatchEdit.storeAction.setEnabled(true);		    PatchEdit.copyAction.setEnabled(true);		    PatchEdit.reassignAction.setEnabled(true);		    PatchEdit.exportAction.setEnabled(true);		}		public void internalFrameClosed(InternalFrameEvent e) {		}	     	     public void internalFrameDeactivated(InternalFrameEvent e) {		    PatchEdit.sendAction.setEnabled(false);		    PatchEdit.playAction.setEnabled(false);		    PatchEdit.storeAction.setEnabled(false);		    PatchEdit.sendToAction.setEnabled(false);		    PatchEdit.copyAction.setEnabled(false);		    PatchEdit.reassignAction.setEnabled(false);		    PatchEdit.exportAction.setEnabled(false);               lostFocus();		}		public void internalFrameDeiconified(InternalFrameEvent e) {		}				public void internalFrameIconified(InternalFrameEvent e) {		}	});    }