Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: How to eliminate warning: unchecked call to additem(E) java as a member of the raw type javax.swing.JComboBox Date: Thu, 30 Aug 2012 13:18:33 -0400 Organization: A noiseless patient Spider Lines: 42 Message-ID: References: <9d55a43a-4981-45a5-b5e1-ac492ea60c8b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 30 Aug 2012 17:18:36 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="ffb8f7085759b339c1002252b48331a4"; logging-data="29459"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/woApjrWzaT5RcXL7fL91R" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: <9d55a43a-4981-45a5-b5e1-ac492ea60c8b@googlegroups.com> Cancel-Lock: sha1:QTn9RY9Xernon3or5auotG2pBho= Xref: csiph.com comp.lang.java.programmer:18436 On 8/30/2012 11:57 AM, clusardi2k@aol.com wrote: > So, is everyone in agreement that the warning can be prevented by modifying the definition of the jcombobox and and not in this "additem". > > I created the jcombobox in NetBeans by dragging it from the swing palette. The definition for it is in code produced by NetBeans and I can't modify. > > What do I do. > > Below is the code that I can't change; > > private void initComponents() { > ... > jComboBox6 = new javax.swing.JComboBox(); > } In the NetBeans form editor, select the JComboBox. In the Properties panel, click the Code tab. Open the Type Parameters editor, enter in the box, and close. > Thank you, It seems to me that you are having more trouble with the NetBeans form designer and its artifacts than with Java and Swing. The designer is an intricate beast, with little controls and menus and twiddly bits festooned all over the landscape, to the extent that I imagine it might take most of a year's solid effort to master the complexity. Someone with that mastery could probably churn out forms faster than someone just typing Java code -- but the typist has several months' head start while the other guy is learning how to use the designer. If you expect to be doing a LOT of form designing, by all means spend the time to learn the form designer inside and out. But if you just want a simple form or three, skip the designer: It will just get in your way (as it seems to be doing now). If you're having trouble achieving some particular effect you might create a mock-up in the designer and study the generated code to get ideas, but I truly think you'll get to a better outcome sooner by writing the Java code yourself. -- Eric Sosman esosman@ieee-dot-org.invalid