I stumbled upon a problem with my program.
What it does: Listens for a row selection in a JTable, uses 'getSelectedRow' to fetch the content of a cell, like so:
public void valueChanged(ListSelectionEvent e) {
int row = resultTable.getSelectedRow();
String val = resultTable.getValueAt(row,2).toString();
System.out.println("The value of cell 2 at selected row is: " + val);
}
What is not shown in the above example is that cell 2 of the JTable contains local paths to images, these paths are fetched from a locally run MySQL Database.
What I want it to do: I wish to use the paths contained in cell 2 of my JTable to draw and display the image in an external JFrame whenever valueChanged(displayed above) is triggered.
Taking the above into consideration (and the fact that I'm fairly new at this), how would I go about passing this 'val' to an ImageIO.read (that I assume will be running in a seperate class?)
Thank you for your time, any help is appriciated!