1

I want to have a GUI application which would contain multiple tabs, each with its own Table. I would like to include a search box below the tabs which would filter the currently selected tab. How can this dynamic behaviour be achieved?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Bober02
  • 15,034
  • 31
  • 92
  • 178
  • 3
    question whats happens with value in "searchbox" in case that in "searchbox" was typed any value and you'll switch to another tab ??? – mKorbel Sep 11 '12 at 08:04
  • where exactly is the problem (except a little logic, as @mKorbel noted)? – kleopatra Sep 11 '12 at 08:06

1 Answers1

3
  1. figure one you can to share RowSorter/RowFilter for all JTables in current JVM instance

    • filtering works for all JTables

    • notice there could be performance issue in the case that there is/are JTable(s) contains bunch of rows

    • quite possible for JTables that contains a few (limited number of) rows together

  2. determine (from arrays of tabs) visible tab, visible JComponents(or have to look at SwingUtilities), then remove RowSorter/RowFilter from all JTables instances and then to add RowSorter/RowFilter to the visible an focusable JTable

  3. JTextField for RowSorter/RowFilter should be crated only once times

Community
  • 1
  • 1
mKorbel
  • 109,525
  • 20
  • 134
  • 319