Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #5004
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.gui |
| Subject | Re: What do these errors mean? |
| Date | 2012-02-12 09:07 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <354004.591.1329066446641.JavaMail.geo-discussion-forums@pbcwt9> (permalink) |
| References | <4f37e5ef$0$2478$db0fefd9@news.zen.co.uk> <jh8qta$b16$1@dont-email.me> |
Knute Johnson wrote: > A B wrote: > > I've finally got around to compiling my program with -Xlint, as the > > compiler kept nagging me to. This is what I got. (I've removed some > > entries for different bits that caused identical errors.) I haven't a > > clue what any of it means or what to do about it; can anyone enlighten > > me? What's a raw type, for instance, and what's a serializable class and > > how do you give it a definition of serialVersionUID? > > ---------------------------------------------- > > Vectorine.java:39: warning: [rawtypes] found raw type: JComboBox > > JComboBox droplist = new JComboBox(); > > ^ > > missing type arguments for generic class JComboBox<E> > > where E is a type-variable: > > E extends Object declared in class JComboBox ... > I can tell you are using Java 7, JComboBox has changed to a generic > class. The simple answer is if you are creating a JComboBox of Strings, > declare it thus; > > JComboBox<String> box = new JComboBox<String>(String[] items) Or, since it's Java 7, JComboBox<String> box = new JComboBox<>(items) (The 'String[]' in an invocation is an error. It is useful to show a possible type for the argument, but is not compilable as such. So, "A B", be sure to vet any code before blindly copying and pasting. Usenet code posts are often, as above, actually pseudocode.) -- Lew
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
What do these errors mean? "A B" <@bleBaker.uk> - 2012-02-12 16:16 +0000
Re: What do these errors mean? Lew <lewbloch@gmail.com> - 2012-02-12 08:54 -0800
Re: What do these errors mean? Knute Johnson <nospam@knutejohnson.com> - 2012-02-12 08:55 -0800
Re: What do these errors mean? Lew <lewbloch@gmail.com> - 2012-02-12 09:07 -0800
Re: What do these errors mean? Knute Johnson <nospam@knutejohnson.com> - 2012-02-12 09:17 -0800
Re: What do these errors mean? Roedy Green <see_website@mindprod.com.invalid> - 2012-02-13 07:47 -0800
Re: What do these errors mean? "A B" <@bleBaker.uk> - 2012-02-16 20:50 +0000
Re: What do these errors mean? Lew <lewbloch@gmail.com> - 2012-02-16 13:01 -0800
Re: What do these errors mean? "A B" <@bleBaker.uk> - 2012-02-16 21:44 +0000
Re: What do these errors mean? Jeff Higgins <jeff@invalid.invalid> - 2012-02-16 17:54 -0500
Re: What do these errors mean? "A B" <@bleBaker.uk> - 2012-02-17 18:21 +0000
Re: What do these errors mean? Roedy Green <see_website@mindprod.com.invalid> - 2012-02-17 15:36 -0800
csiph-web