0

Please can anyone help me with a simple sample on how to populate JCombobox with data(mysql etc) using Java persistence (JPA). I am quite new to this component so I desperately need help with this.

Edited by kwesiaryee

2
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by radhakrishna.p
0

use addItem() method of JCombobox class for adding data to your combobox which is placed on your GUI.i d'not know exactly how to use JPA in java but the following code will help you see it

if you know how to read data using and for example (if your data is in result set object)

jComboBox1.removeAllItems();
/* update fresh data to JcomboBox1 component as follows*/
while(rs.next){
    jCombobox1.addItem(rs.getString(1));
}

all the best,
radha krishna.p

0

use addItem() method of JCombobox class for adding data to your combobox which is placed on your GUI.i d'not know exactly how to use JPA in java but the following code will help you see it

if you know how to read data using and for example (if your data is in result set object)

jComboBox1.removeAllItems();
/* update fresh data to JcomboBox1 component as follows*/
while(rs.next){
    jCombobox1.addItem(rs.getString(1));
}

all the best,
radha krishna.p

0

use addItem() method of JCombobox class for adding data to your combobox which is placed on your GUI.i d'not know exactly how to use JPA in java but the following code will help you see it

if you know how to read data using and for example (if your data is in result set object)

jComboBox1.removeAllItems();
/* update fresh data to JcomboBox1 component as follows*/
while(rs.next){
    jCombobox1.addItem(rs.getString(1));
}

all the best,
radha krishna.p

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.