Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.gui Subject: Re: What do these errors mean? Date: Sun, 12 Feb 2012 08:54:06 -0800 (PST) Organization: http://groups.google.com Lines: 88 Message-ID: <27486591.640.1329065646306.JavaMail.geo-discussion-forums@pbd3> References: <4f37e5ef$0$2478$db0fefd9@news.zen.co.uk> NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1329065760 23223 127.0.0.1 (12 Feb 2012 16:56:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 12 Feb 2012 16:56:00 +0000 (UTC) In-Reply-To: <4f37e5ef$0$2478$db0fefd9@news.zen.co.uk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:5002 On Sunday, February 12, 2012 8:16:44 AM UTC-8, 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? You need to read the Java tutorials before you code. Every single one of those terms is eminently searchable, did you but take the effort to do so: The first result of which points to the Java Language Specification, which has an entire section on raw types: The tutorial explains your problem: "When a generic type like Collection is used without a type parameter, it's called a raw type." You need to read the Java API docs as you code. If you look at the docs for 'JComboBox' you will see that it's a generic type: You neglected to specify the item type for the combo box. You show us none of your code, for shame, but clearly you defined your class as 'implements Serializable' ('implements java.io.Serializable'). This is in your code, so presumably you looked up the API docs for 'Serializable' and read them thoroughly. Otherwise, why did you use it? A "serializable class" is one defined that it 'implements Serializable', and in the Javadocs for that interface they explain about 'serialVersionUID'. Read it. Then, do not use 'Serializable'. Do not use it. Stop using it. Until you have purchased and studied /Effective Java/ (2nd ed.) by Joshua Bloch. which devotes its entire Chapter 11 to serialization and 'Serializable'. You must not use Java serialization until you properly understand it! /Effective Java/ has the best explanation of serialization, its dangers (of which there are many) and how to circumvent them. Next time, post an SSCCE. http://sscce.org/ > ---------------------------------------------- > Vectorine.java:39: warning: [rawtypes] found raw type: JComboBox > JComboBox droplist = new JComboBox(); > ^ > missing type arguments for generic class JComboBox > where E is a type-variable: > E extends Object declared in class JComboBox The message is pretty darned clear. You are missing the type arguments. So add type arguments! See the Javadocs, linked above. > ... > Vectorine.java:21: warning: [serial] serializable class Vectorine has no > definition of serialVersionUID > public class Vectorine extends JFrame implements ItemListener, MouseListener > ^ > ---------------------------------------------- Don't declare the class 'Serializable'. > (DatasetReader is another class in my program, which the main class creates > an instance of so it can use its methods to look up data. Anything else I > should explain, just tell me.) Stop the hand waving. If code is relevant, show the code, don't just describe it. http://sscce.org/ In your case, the problem is not in the code but in insufficient study beforehand. Read the tutorial before setting finger to keyboard to code again. *LOOK UP* terms that you don't recognize! Read the Javadocs. GIYF. -- Lew