This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A (silly) Applet question..............

 
Steve Jensen
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok folks, i'm back.
I used to be sort of semi-regular on here, but close bereavement seriously threw me off course, for a fair time. :roll:
Still adjusting, as well.
But anyway, i've started back on my java, and have a query on applets. It seems i've fallen at the first hurdle...................
OK, i says in Sams' "learn java in 21 days" that "all applets are subclasses of either the JApplet class in the javax.swing package, or its superclass, the Applet class, in the java.applet package. The JApplet class is a better choice because it supports Swing."

What I don't get is, if the Applet class is the superclass, shouldn't this be the better choice, as being the superclass, it is all encompassing. Or am i visualising this the wrong way. And that the Swing is created lower down in a subclass from the Applet class, and is therefore not 'seen' by this superclass.
I have just asked the dumbest question of the year, probably, on the most basic concept of OO programming. But folks, believe me, for me, it's been a while!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More specialized classes -- subclasses -- are the ones that add additional features.
Now actually, I'd take strong exception to the statement you're quoting, as "better" is relative to what it is you need to do. If you want to write an applet that runs only in Sun's Java plug-in, then you can go with JApplet. If you want to run in the Microsoft VM, or the old VM that comes with Netscape, then you more or less need to stick with Applet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic