PatchBasket library=(PatchBasket)PatchEdit.desktop.getSelectedFrame();
PatchBasket library=(PatchBasket)JSLDesktop.getSelectedFrame();
  public CrossBreedDialog(JFrame Parent) {        super(Parent,"Patch Cross-Breeder",false);        crossBreeder = new CrossBreeder();	JPanel container= new JPanel();        container.setLayout (new BorderLayout());        JPanel p4 = new JPanel();        p4.setLayout (new ColumnLayout());	l1 = new JLabel("Patch Type: ");	JPanel buttonPanel = new JPanel();	JPanel buttonPanel2=new JPanel();	JButton gen = new JButton("Generate");	gen.addActionListener(new ActionListener() {	                       public void actionPerformed(ActionEvent e) {                                   generatePressed();			       }});        buttonPanel2.add(gen);	JButton play = new JButton("Play");	play.addActionListener(new ActionListener() {	                       public void actionPerformed(ActionEvent e) {                                 play();			       }});        buttonPanel2.add(play);	JButton keep = new JButton("Keep");	keep.addActionListener(new ActionListener() {	                       public void actionPerformed(ActionEvent e) {			       try {			        PatchBasket library=(PatchBasket)PatchEdit.desktop.getSelectedFrame();				Patch q=PatchEdit.Clipboard;				PatchEdit.Clipboard=crossBreeder.getCurrentPatch();				library.PastePatch();				PatchEdit.Clipboard=q;			       }catch (Exception ex){JOptionPane.showMessageDialog(null, "Destination Library Must be Focused","Error", JOptionPane.ERROR_MESSAGE);}			       }});        buttonPanel2.add(keep);	JButton ok = new JButton("Close");        ok.addActionListener(new ActionListener() {	                       public void actionPerformed(ActionEvent e) {                                   OKPressed();			       }});	buttonPanel.add( ok );	getRootPane().setDefaultButton(ok);        p4.add(l1);	container.add(p4,BorderLayout.NORTH);	container.add(buttonPanel2,BorderLayout.CENTER);	container.add(buttonPanel,BorderLayout.SOUTH);	getContentPane().add(container);       // setSize(400,300);        pack();	centerDialog();  }