ListSelectionListener getting cell value and assigning it to a variable
Joined: Aug 23, 2012
i have set up a selectionListener on a JTable to select an id of a particular row. ID is a column in the row (col 0). i checked this within the ListCustPanel class that follows by having it printout the selectedID, it worked. but ive added the method getSelectedID() to get the selectedID for other classes that use the Panel, and it seems that the variable never gets assigned. whats the problem here?
so what im trying to say is i have another JFrame class as such, and im getting a null pointer exception from where i use the getSelectedID() method:
this means, no row has been selected by the user yet. This code is present in the constructor of the frame. How would the user select a row before the JFrame, JPanel are constructed and shown to the user?