How to add different combobox to a cell
up vote
0
down vote
favorite
I have a combobox which I am filling with database query, my combo box must be different for each row, but when adding it, it shows me the combo box with the same data for all.
I add it with this method
CComboBox priceListVersionComboBox = new CComboBox(priceListVersion);
TableColumn col = table.getColumnModel().getColumn(COLUMN_PRICELIST);
col.setCellEditor(new DefaultCellEditor(priceListVersionComboBox));
My ComboBox It is filled by
KeyNamePair priceListVersion = getMPriceListVersion((Integer)table.getValueAt(i, COLUMN_PRODUCTID));
How do I add the value of the current combobox per row and the previous ones keep them?
java swing combobox
add a comment |
up vote
0
down vote
favorite
I have a combobox which I am filling with database query, my combo box must be different for each row, but when adding it, it shows me the combo box with the same data for all.
I add it with this method
CComboBox priceListVersionComboBox = new CComboBox(priceListVersion);
TableColumn col = table.getColumnModel().getColumn(COLUMN_PRICELIST);
col.setCellEditor(new DefaultCellEditor(priceListVersionComboBox));
My ComboBox It is filled by
KeyNamePair priceListVersion = getMPriceListVersion((Integer)table.getValueAt(i, COLUMN_PRODUCTID));
How do I add the value of the current combobox per row and the previous ones keep them?
java swing combobox
1
See: stackoverflow.com/questions/4211452/… for one approach.
– camickr
Nov 12 at 20:09
Possible duplicate of How to add unique JComboBoxes to a column in a JTable (Java)
– michaeak
Nov 12 at 20:24
No, it's not the same. There are different comboboxes created, I have a single combo box for many rows and I need that for each one depends on the row I have a specific value
– Luis Morales
Nov 12 at 21:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a combobox which I am filling with database query, my combo box must be different for each row, but when adding it, it shows me the combo box with the same data for all.
I add it with this method
CComboBox priceListVersionComboBox = new CComboBox(priceListVersion);
TableColumn col = table.getColumnModel().getColumn(COLUMN_PRICELIST);
col.setCellEditor(new DefaultCellEditor(priceListVersionComboBox));
My ComboBox It is filled by
KeyNamePair priceListVersion = getMPriceListVersion((Integer)table.getValueAt(i, COLUMN_PRODUCTID));
How do I add the value of the current combobox per row and the previous ones keep them?
java swing combobox
I have a combobox which I am filling with database query, my combo box must be different for each row, but when adding it, it shows me the combo box with the same data for all.
I add it with this method
CComboBox priceListVersionComboBox = new CComboBox(priceListVersion);
TableColumn col = table.getColumnModel().getColumn(COLUMN_PRICELIST);
col.setCellEditor(new DefaultCellEditor(priceListVersionComboBox));
My ComboBox It is filled by
KeyNamePair priceListVersion = getMPriceListVersion((Integer)table.getValueAt(i, COLUMN_PRODUCTID));
How do I add the value of the current combobox per row and the previous ones keep them?
java swing combobox
java swing combobox
edited Nov 12 at 23:03
Brian Tompsett - 汤莱恩
4,153133699
4,153133699
asked Nov 12 at 19:58
Luis Morales
1034
1034
1
See: stackoverflow.com/questions/4211452/… for one approach.
– camickr
Nov 12 at 20:09
Possible duplicate of How to add unique JComboBoxes to a column in a JTable (Java)
– michaeak
Nov 12 at 20:24
No, it's not the same. There are different comboboxes created, I have a single combo box for many rows and I need that for each one depends on the row I have a specific value
– Luis Morales
Nov 12 at 21:03
add a comment |
1
See: stackoverflow.com/questions/4211452/… for one approach.
– camickr
Nov 12 at 20:09
Possible duplicate of How to add unique JComboBoxes to a column in a JTable (Java)
– michaeak
Nov 12 at 20:24
No, it's not the same. There are different comboboxes created, I have a single combo box for many rows and I need that for each one depends on the row I have a specific value
– Luis Morales
Nov 12 at 21:03
1
1
See: stackoverflow.com/questions/4211452/… for one approach.
– camickr
Nov 12 at 20:09
See: stackoverflow.com/questions/4211452/… for one approach.
– camickr
Nov 12 at 20:09
Possible duplicate of How to add unique JComboBoxes to a column in a JTable (Java)
– michaeak
Nov 12 at 20:24
Possible duplicate of How to add unique JComboBoxes to a column in a JTable (Java)
– michaeak
Nov 12 at 20:24
No, it's not the same. There are different comboboxes created, I have a single combo box for many rows and I need that for each one depends on the row I have a specific value
– Luis Morales
Nov 12 at 21:03
No, it's not the same. There are different comboboxes created, I have a single combo box for many rows and I need that for each one depends on the row I have a specific value
– Luis Morales
Nov 12 at 21:03
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269243%2fhow-to-add-different-combobox-to-a-cell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
See: stackoverflow.com/questions/4211452/… for one approach.
– camickr
Nov 12 at 20:09
Possible duplicate of How to add unique JComboBoxes to a column in a JTable (Java)
– michaeak
Nov 12 at 20:24
No, it's not the same. There are different comboboxes created, I have a single combo box for many rows and I need that for each one depends on the row I have a specific value
– Luis Morales
Nov 12 at 21:03