Article View: borland.public.jbuilder.java.language
Article #8267Re: Exception in thread "main"
From: Marcel Gabi
Date: Tue, 03 Apr 2001 17:56
Date: Tue, 03 Apr 2001 17:56
54 lines
2817 bytes
2817 bytes
Oooops, I guess I used just the wrong word to mention that I would be better to stick to the suggestion to always store reference in a variable even though you do not need to do so. Thanks Hartmut! And yes, it is really worth using projects when working with JBuilder since JBuilder uses a project to add its .class files to the classpath when running the project. (To be precise, JBuilder adds the 'class' folder of the project to the classpath when running the project). Regards, Marcel Hartmut wrote: > 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:
<3ACA0EE2.424B220F@borland.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnewsReferences:
<3AC8CE1A.CFD3E0CE@bluewin.ch> <3ac980f3_1@dnews>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 11:04:03 PST Message-ID: <3ACA0EE2.424B220F@borland.com> Date: Tue, 03 Apr 2001 10:56:50 -0700 From: Marcel Gabi <mgabi@borland.com> Organization: Borland Software Corporation X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: Exception in thread "main" References: <3AC8CE1A.CFD3E0CE@bluewin.ch> <3ac980f3_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 10.143.12.99 X-Trace: dnews 986320733 10.143.12.99 (3 Apr 2001 10:58:53 -0700) Lines: 55 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews