Java Swing JTable select programmatically multiple rows
I have a JTable with multiple rows and every row is presented via Point on a scatter plot. What I have to do is when a given point is selected on the scatter plot I have to associate this selection with selecting of the corresponding row in the JTable. I have an Integer that represents, which row I have to highlight. What I tried is: JTable table = new JTable(); ... ...// a bit of code where I have populated the table ... table.setRowSelectionInterval(index1,index2); So the problem here is that this method selects all rows in the given range [index1,index2]. I want to select for example rows 1