Start New Discussion within our Software Development Community

i had use combo box like this

   {jComboBox2.addItem("-- pilih menu --");
          try {
            String sql = "select * from iomenu";
            Statement cn = con.createStatement();
            ResultSet rs = cn.executeQuery(sql);
            while (rs.next()) {
                jComboBox2.addItem(rs.getString("KodeMenu"));
            }
        } catch (Exception e) {
        }
     }

but when i build that was had warning like this
warning: [unchecked] unchecked call to addItem(E) as a member of the raw type JComboBox
where E is a type-variable:
E extends Object declared in class JComboBox

what should i do?

you should delete your code and start learn the basics.
first of all: for this, you don't need to do anything, it's a warning, not an error message.

secondly, in the other posts you've made on the forum, you've made it clear you don't have sufficient knowledge of the basics of Java programming to go for more advanced items, like Swing GUI's (even though even that is part of the basics).

last remark I'm going to make here:

catch (Exception e) {
        }

if you don't know why this might cause you days (if not weeks/months/...) of not understanding where everythibng goes wrong if your application fails, or why this is very bad design ... well, you really should look into Exception handling as well.

This question has already been answered. Start a new discussion instead.