Results 1 to 1 of 1
Thread: What is killing this?
- 02-04-2011, 04:24 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 24
- Rep Power
- 0
What is killing this?
I have this query that kindof works but when I try to remove the frame and just add it to a button on the main GUI it no longer works? Any help appreciated!
Java Code:@Action public void Query() { try{ JFrame frame = new JFrame("Sorting JTable"); final TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(masterTable.getModel()); masterTable.setRowSorter(sorter); masterScrollPane.add(masterTable); JButton button = new JButton("Filter"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String text = findField.getText(); if (text.length() == 0) { sorter.setRowFilter(null); } else { try { sorter.setRowFilter( RowFilter.regexFilter(text)); } catch (PatternSyntaxException pse) { System.err.println("Bad regex pattern"); } } } }); frame.add(button, BorderLayout.SOUTH); frame.setSize(100, 100); frame.setVisible(true); } catch (Exception e) { System.err.println("Got an exception! "); System.err.println(e.getMessage()); } }
Similar Threads
-
Recursion Instance Killing
By Vinod Mukundan in forum Advanced JavaReplies: 5Last Post: 07-23-2010, 12:19 PM -
GUI not killing processes when X is used to exit
By TimHuey in forum NetBeansReplies: 22Last Post: 09-06-2009, 05:21 PM -
killing a java process
By paritoshcg in forum Advanced JavaReplies: 3Last Post: 12-01-2008, 08:16 AM -
Killing an Ill-behaved Thread
By John6715 in forum Threads and SynchronizationReplies: 6Last Post: 10-03-2008, 08:35 AM -
Thread killing
By denis in forum Threads and SynchronizationReplies: 13Last Post: 09-25-2008, 09:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks