}
String patchType; PatchBasket library=(PatchBasket)JSLDesktop.getSelectedFrame(); Patch q	= library.GetSelectedPatch();  JPanel container= new JPanel(); container.setLayout (new BorderLayout()); JPanel p4 = new JPanel(); p4.setLayout (new ColumnLayout()); JLabel l1 = new JLabel("Patch Type: "); t1 = new JTextField(20); JLabel l2 = new JLabel("Patch Name: "); t2 = new JTextField(20); t2.setText(q.getDriver().getPatchName(q)); t1.setEditable(false);  patchType= q.getDriver().getManufacturerName(); patchType+=" "; patchType+=q.getDriver().getModelName(); t1.setText(patchType);  JLabel l4 = new JLabel("Repository:"); t4=new JTextField(20); t4.setText(PatchEdit.appConfig.getRepositoryURL()); JLabel l5 = new JLabel("Contributor: "); t5=new JTextField(20); t5.setText(PatchEdit.appConfig.getRepositoryUser()); JLabel l6 = new JLabel("Contributor Password: "); t6=new JPasswordField(20); t6.setText(PatchEdit.appConfig.getRepositoryPass());  JLabel l3 = new JLabel("Description: "); t3 = new JTextArea(4,50); t3.setText(q.getComment());   JPanel buttonPanel = new JPanel(); JButton upload = new JButton("Upload"); upload.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { PatchBasket library=(PatchBasket)JSLDesktop.getSelectedFrame(); Patch q	= library.GetSelectedPatch(); uploadPatch(q); }catch (Exception ex){JOptionPane.showMessageDialog(null, "Patch Must be Focused","Error", JOptionPane.ERROR_MESSAGE);} }}); buttonPanel.add(upload); JButton play = new JButton("Play"); play.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { play(); }}); buttonPanel.add(play);  JButton ok = new JButton("Cancel"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { OKPressed(); }}); buttonPanel.add( ok ); getRootPane().setDefaultButton(ok); p4.add(l4);p4.add(t4); p4.add(l5);p4.add(t5); p4.add(l6);p4.add(t6); p4.add(l1);p4.add(t1); p4.add(l2);p4.add(t2); p4.add(l3);p4.add(t3);   container.add(p4,BorderLayout.NORTH); container.add(buttonPanel,BorderLayout.SOUTH); getContentPane().add(container);  pack(); centerDialog();   }
  public UploadPatchDialog(JFrame Parent) {        super(Parent,"Upload Patch to Repository",false); 	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 upload = new JButton("Upload");	upload.addActionListener(new ActionListener() {	                       public void actionPerformed(ActionEvent e) {                                try {					PatchBasket library=(PatchBasket)JSLDesktop.getSelectedFrame();					Patch q	= library.GetSelectedPatch();					uploadPatch(q);			       }catch (Exception ex){JOptionPane.showMessageDialog(null, "Patch Must be Focused","Error", JOptionPane.ERROR_MESSAGE);}			       }});        buttonPanel2.add(upload);	JButton play = new JButton("Play");	play.addActionListener(new ActionListener() {	                       public void actionPerformed(ActionEvent e) {                                 play();			       }});        buttonPanel2.add(play);	JButton ok = new JButton("Cancel");        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();  }