In c# we can add a text and a value to each items of combobox, I want to know is开发者_StackOverflow社区 it possible in Java also? if not please advice.
I Solved my problem by create a class like
public class ItemInfo {
    public String Name;
    public String Value;
    public ItemInfo(String Name , String Value) {
        this.Name = Name;
        this.Value = Value;
    }
    public String toString() {
      return Name ;
    }
    public String getValue() {
      return Value ;
    }
}
than I just create a new object from this class & pass it to my combobox
combbox1.addItem(new ItemInfo(item[0],item[1]));
job done :)!
You should learn how to use ComboBox in java.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论