Collections.sort (((LibraryFrame)PatchEdit.desktop.getSelectedFrame ()).myModel.PatchList,new myOrder (command)); ((LibraryFrame)PatchEdit.desktop.getSelectedFrame ()).myModel.fireTableDataChanged ();
Collections.sort (((LibraryFrame)JSLDesktop.getSelectedFrame ()).myModel.PatchList,new myOrder (command)); ((LibraryFrame)JSLDesktop.getSelectedFrame ()).myModel.fireTableDataChanged ();
    public SortDialog (JFrame Parent)    {        super(Parent,"Library Sort",true);        JPanel container= new JPanel ();        container.setLayout (new BorderLayout ());        JLabel myLabel=new JLabel ("Please select a Field to Sort the Library by.",JLabel.CENTER);        try        {            container.add (myLabel, BorderLayout.NORTH);            final ButtonGroup group=new ButtonGroup ();            JRadioButton button1 = new JRadioButton ("Patch Name");            button1.setActionCommand ("P");            JRadioButton button2 = new JRadioButton ("Field 1");            JRadioButton button4 = new JRadioButton ("Synth Name");            button4.setActionCommand ("S");            JRadioButton button5 = new JRadioButton ("Patch Type");            button5.setActionCommand ("T");            button2.setActionCommand ("1");            JRadioButton button3 = new JRadioButton ("Field 2");            button3.setActionCommand ("2");            group.add (button1);            group.add (button4);            group.add (button5);            group.add (button2);            group.add (button3);            button1.setSelected (true);            JPanel radioPanel=new JPanel ();            radioPanel.setLayout (new ColumnLayout ());            radioPanel.add (button1);            radioPanel.add (button4);            radioPanel.add (button5);            radioPanel.add (button2);            radioPanel.add (button3);            container.add (radioPanel,BorderLayout.CENTER);            JPanel buttonPanel = new JPanel ();            buttonPanel.setLayout ( new FlowLayout () );            JButton done = new JButton (" OK ");            done.addActionListener (new ActionListener ()            {                public void actionPerformed (ActionEvent e)                {                    setVisible (false);                    PatchEdit.waitDialog.show ();                    String command = group.getSelection ().getActionCommand ();                    Collections.sort (((LibraryFrame)PatchEdit.desktop.getSelectedFrame ()).myModel.PatchList,new myOrder (command));                    ((LibraryFrame)PatchEdit.desktop.getSelectedFrame ()).myModel.fireTableDataChanged ();                    PatchEdit.waitDialog.hide ();                }});                buttonPanel.add ( done );                JButton cancel = new JButton ("Cancel");                cancel.addActionListener (new ActionListener ()                {                    public void actionPerformed (ActionEvent e)                    {                        setVisible (false);                    }});                    buttonPanel.add ( cancel );                    getRootPane ().setDefaultButton (done);                    container.add (buttonPanel, BorderLayout.SOUTH);                    getContentPane ().add (container);                    pack ();                    centerDialog ();        }catch(Exception e)        {ErrorMsg.reportStatus (e);}    }