Dynamically adding items to a JComboBox

后端 未结 3 875
甜味超标
甜味超标 2020-11-27 19:33
Vector comboBoxItems = new Vector();
DefaultComboBoxModel model;
// ComboBox Items have gotten from Data Base initially.
model = new DefaultComboBoxModel(ComboBoxIte         


        
3条回答
  •  清歌不尽
    2020-11-27 19:40

    Dynamically adding items like JComboBox,JTextField and ImageIcon

    Please,Show this image on display, how many items added or Table Fields size

    After second images are display on Items like JComboBox,JTextField and ImageIcon

    for example : count=3
    //Dynamically Adding Items or Component above method
    public void  dya_addcomp(int count)
    {
    //Dynamicly Drop/Delete icon
     BufferedImage Drop_Tablefield = null;
     try {
         Drop_Tablefield = ImageIO.read(this.getClass().getResource("/images/drop.png"));
     } catch (IOException ex) {
         msg(" Error: drop and edit icon on Table, "+ex);
     }
     //count Items for loop executed..
     for(int i=0;i

提交回复
热议问题