This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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?
SCJP 1.4, OCMJEA/SCEA 5.0.
subject: ListSelectionListener getting cell value and assigning it to a variable