Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / May 2005

Tip: Looking for answers? Try searching our database.

Applet Changes in 1.5_03 SDK?

Thread view: 
Jammin Jay - 30 May 2005 20:12 GMT
Hello Everyone,

I recently installed NetBeans 4.1 and the latest JDK (build 1.5.0_03-b07).
I have been working out of a text book from SNHU programming an applet that is a calculator.  My problem is when the applet executes, both in the browser and applet viewer, the paint method goes into a viscous loop that never ends..
Has something changed with this latest JVM?  Am I missing something?  

The code :

   public void paint(Graphics g) {
       resize(row1.getWidth(), 8*d1.getHeight());
       validate();
   }

row1 is a Panel and d1 is a Button object.

I have attached the complete code for the interface to this post.  Any help would be greatly appreciated.

Jason
Noem - 30 May 2005 23:17 GMT
Applets... the final frontier!  I haven't even touched applets in months, so
here goes...

I have no idea why it would do that. But it's got something to do with
refreshing the screen obviously. After commenting out all the instructions
in the paint() method and running the applet with a specified width of 150
pixels in the HTML file it seems to work fine.

<APPLET CODE="CalculatorApplet.class" WIDTH=150 HEIGHT=250></APPLET>

Regards

--
Ewald Horn
Business Manager
NoFuss Solutions
South Africa / Suid Afrika
Tel : +27 (0)83 305 3556
Web : http://www.nofusspos.com
Email / E-pos : ewald@nofusspos.com
Jammin Jay - 31 May 2005 02:13 GMT
Thanks Noem,

The Author of this book was trying to introduce layout managers and event
handling.  I even used his code and got the same results.  After some
snooping I found a slightly different workaround..  I just overrode the
start() method and called setSize() method with the parameters used in the
resize method...  I also junked the validate call.
I should have guessed that there would be more problems with the book..  I
was very disappointed with the class that I took, it wasn't challenging at
all.   I come from a C/C++ background and I expected the course to cover GUI
based OO application development, but I couldn't have been more wrong... The
entire course just used console apps to rehash every simple concept I have
ever had in other languages..
Picking out the authors errors and figuring out what needs to be done to fix
them is more satisfying.

J

> Applets... the final frontier!  I haven't even touched applets in months,
> so
[quoted text clipped - 17 lines]
> Web : http://www.nofusspos.com
> Email / E-pos : ewald@nofusspos.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.