Dynamically Creating User Selection through ResultSet
Hello,
So my question is really as simple as the title reads, I'm retrieving some customer products from database and populating a JTable through ResultSet. Using this method can I assign a radio button group for which each button has the value of productID?
What method of approach would I take when doing this? If using JTable, how would I go about it? or are there easier approaches to the problem? At the moment I'm using a text input as user selection, which for lack of a better word is a 'crap' approach.
Kind Regards,
Re: Dynamically Creating User Selection through ResultSet
At what point are you stuck? Do you want to show a JRadioButton in a JTable and don't know how? I'm not sure I'm following what exactly you want to do, what data you have, etc...
Re: Dynamically Creating User Selection through ResultSet
Sorry, I could have explained myself better.
Thats right, my application is that of a booking system (or at least this part of it is) and the bookings are made depending on faulty products.
Customers have many products and therefore needs a method for the user to select a product once the JTable for a customer's products is displayed.
I'm currently reading ResultSet into JTable, that all works fine(and to be honest I skipped out the JRadioButton part because I wanted to
get functionality sorted before i went back to 'niggly' points). I'm retrieving the primary key and a couple of strings at the moment.
I have a class which deals with all the database queries, the method from that class passes the ResultSet to the JFrame and all the calculations
for rows etc take place in the JFrame before my(or NetBean's) InitComponents() method is fired.
But yeah, the top and bottom of it is that I'm not sure how to get a JRadioButton into the JTable, I did get one in there, but I'm not sure
the method of approach behind adding one for each record(and somehow relating this to each record that I'm retrieving)
Re: Dynamically Creating User Selection through ResultSet
So, I can get an extra column at the end of my jTable, but jTable simply outputs this jRadioButton's memory location as a string, surely this must be a pretty standard thing to do.