Article View: borland.public.jbuilder.java.language
Article #8262Re: Exception in thread "main"
From: Hartmut
Date: Tue, 03 Apr 2001 07:52
Date: Tue, 03 Apr 2001 07:52
33 lines
2220 bytes
2220 bytes
Mike, against the two previous postings, it's not necessary in your main method to save the reference of the new object in a variable. I tried your code, and it works fine! You simply made a typical JBuilder newbie mistake: JBuilder doesn't know that it shall execute the main method of this class. I took this way to use your class - not that this would be the way I would recommend also for you to work with JBuilder: 1) I created a new project 2) In this project I created a new application named "uebung_3". JBuilder also allows (leads) me to create a frame by this. 3) Now i Have an application clas with main method and a JFrame class. Look at the code and figure it out - will help you very much! 4) Since I wanted to try your class, a combination of main method and frame, I deleted the generated Frame, and I replaced the code of the application class by your code. My class uebung_3 is simply your code, only additional 1 package command at the top. Compiles and executes - all ok. In fact JBuilder gives you great help, but everything must be in a project, and you should let it generate application and frame like I showed you. Finally: Please follow that advice to call your class Java-typical: Uebung3. Hope this helps you to get a Java crack. Regards, Hartmut
Technical Details
Message-ID:
<3ac980f3_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3AC8CE1A.CFD3E0CE@bluewin.ch>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,eff8c91282e89dda X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-03 00:54:40 PST From: "Hartmut" <hartmut.kiessling@bnhof.de> Newsgroups: borland.public.jbuilder.java.language References: <3AC8CE1A.CFD3E0CE@bluewin.ch> Subject: Re: Exception in thread "main" Date: Tue, 3 Apr 2001 09:52:02 +0200 Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 217.3.245.132 Message-ID: <3ac980f3_1@dnews> X-Trace: dnews 986284275 217.3.245.132 (3 Apr 2001 00:51:15 -0700) Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews