Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: It doesn't like 'super' where ever I put it. Date: Mon, 11 Jun 2012 16:42:55 -0700 (PDT) Organization: http://groups.google.com Lines: 32 Message-ID: <52179c3c-c8d0-4ff6-abce-78b8fa4d154b@googlegroups.com> References: NNTP-Posting-Host: 69.28.149.29 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1339458175 4231 127.0.0.1 (11 Jun 2012 23:42:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 11 Jun 2012 23:42:55 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.programmer:15214 Martin Gregorie wrote: > Gavino wrote: >> Robert Klemme wrote ... >> Gavino wrote: >>>> It can't because the superclass (JFrame) does not have a constructor >>>> without arguments. >> >>> Also wrong. >> >>> >> >> My apologies. >> I don't know where I got that erroneous idea from, but somehow I've been >> carrying it around in my head for the last 12 years. >> I should have checked the JavaDocs instead of relying on badly >> remembered information. >> >> Now I'm equally confused about the wording of the error message. > > As Stefan said, I believe its objecting to the call to > super("CalcFrame1") in the class erroneously declared as > "public void CalcFrame1()". Here's the chain: The rule for 'super()' constructor calls is that they must appear only as the first line in a constructor. The OP put it in a different place, inside a method, violating the rule stated in the error message: "Constructor must call super() or this() before return in method CalcFrame1.()V at offset 0" That's not where the OP's code called 'super()'. Ergo, it violated that rule. -- Lew