if (PatchEdit.desktop.getSelectedFrame() instanceof SceneFrame)
if (JSLDesktop.getSelectedFrame() instanceof SceneFrame)
   public SearchDialog(JFrame Parent) {        super(Parent,"Search Library",false);	JPanel container= new JPanel();        container.setLayout (new BorderLayout());        JPanel searchFor = new JPanel();        JLabel label = new JLabel("Search For");        final JTextField textField = new JTextField(30);        searchFor.setLayout(new FlowLayout());        searchFor.add(label);        searchFor.add(textField);	try {        searchFor.setLayout(new FlowLayout());        searchFor.add(label);        searchFor.add(textField);        container.add(searchFor, BorderLayout.NORTH);        final ButtonGroup group=new ButtonGroup();	JRadioButton button1 = new JRadioButton("Patch Name");        button2 = new JRadioButton("Field 1");        button3 = new JRadioButton("Field 2");        JRadioButton button4 = new JRadioButton("Comment");        JRadioButton button5 = new JRadioButton("All Fields");        button1.setActionCommand("P");        button2.setActionCommand("1");        button3.setActionCommand("2");        button4.setActionCommand("C");        button5.setActionCommand("A");         group.add(button1);         group.add(button2);         group.add(button3);         group.add(button4);         group.add(button5);         if (PatchEdit.desktop.getSelectedFrame() instanceof SceneFrame)         {             button2.setEnabled(false);             button3.setEnabled(false);         }         button1.setSelected(true);	 JPanel radioPanel=new JPanel();         radioPanel.setLayout(new FlowLayout());	 radioPanel.add(button1);         radioPanel.add(button2);         radioPanel.add(button3);         radioPanel.add(button4);         radioPanel.add(button5);         container.add(radioPanel,BorderLayout.CENTER);	 JPanel buttonPanel = new JPanel();        buttonPanel.setLayout ( new FlowLayout() );        JButton findFirst = new JButton(" Find First ");        JButton findNext = new JButton(" Find Next ");        findFirst.addActionListener(new ActionListener() {	           	       public void actionPerformed(ActionEvent e){				   String command = group.getSelection().getActionCommand();                                   String text = textField.getText();                                   findString(text, command,true);                        	}});        findNext.addActionListener(new ActionListener() {	           	       public void actionPerformed(ActionEvent e){                                   String text = textField.getText();				   String command = group.getSelection().getActionCommand();                                   findString(text,command,false);				}});        buttonPanel.add( findFirst );        buttonPanel.add( findNext );        JButton cancel = new JButton("Cancel");        cancel.addActionListener(new ActionListener() {	                       public void actionPerformed(ActionEvent e) {                                   setVisible(false);			       }});        buttonPanel.add( cancel );        getRootPane().setDefaultButton(findFirst);	container.add(buttonPanel, BorderLayout.SOUTH);	getContentPane().add(container);        pack();	centerDialog();	   }catch(Exception e) {ErrorMsg.reportStatus(e);}  }