title: How to know which jtable has a selected row
body: <p>I have a GUI that has multiple tables each in its own tab. Each table is configured to only allow single selections and to clear its selection when another tab is clicked. I have a delete button that deletes a selected row. I tried using isVisible() to determine which table was being displayed but it seems to regard all tables as visible. I need a way to find out which table either has a selected row, or which table is visible to the user (as in which tab is open).</p>
  <p>Here is an example of my incorrect method:</p>
  <pre><code>if(jtblSunLessons.isVisible()){
              Day = &quot;Sunday&quot;;
              startTime = jtblSunLessons.getValueAt(jtblSunLessons.getSelectedRow(), 0).toString();
          }
          else if(jtblMonLessons.isVisible()){
              Day = &quot;Monday&quot;;
              startTime = jtblMonLessons.getValueAt(jtblMonLessons.getSelectedRow(), 0).toString();
          }
          else if(jtblTuesLessons.isVisible()){
              Day = &quot;Tuesday&quot;;
              startTime = jtblTuesLessons.getValueAt(jtblTuesLessons.getSelectedRow(), 0).toString();
          }
  </code></pre>
  <p>Column 0 is the starting time of a lesson.
  Day and startTime are strings.
  Thanks!</p>