Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can anyone tell me why this doesn't work?

 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I should probably be running a bait shop instead of coding, but here goes... I am writing an applet to show data from a database. This is just an test, the end result will actually have xml flying around with html/jsp front ends and ejb's on the back side. Right now, I want it to show up on a page in an applet.
Well, actually, I want ANYTHING to show up in an applet.
I'm trying to use swing components (JFrame, etc) and I can't get past this point. Even when I use the hardcoded values, they don't work.
HELP!!!


[ May 13, 2002: Message edited by: Sam Smoot ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple of things, Sam:
  • You have a main class with an inner class. Your main class doesn't do anything except define the innerclass - the inner class is never instantiated. So, add code to the main class that instantiates and uses the innerclass.
  • When you do that and run the applet, you'll discover that you have some other flaws.
  • Here's your code with a few changes to begin to do what you may have been trying (note that the code still doesn't make complete sense):
    Good Luck.
     
    Sam Smoot
    Ranch Hand
    Posts: 238
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks. Any direction is better than none... I'll keep plugging at it...
     
    Dirk Schreckmann
    Sheriff
    Posts: 7023
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    A couple of trails and lesssons from Sun's Java Tutorial that you might want to peruse:
  • Writing Applets
  • Creating a GUI with JFC/Swing
  • Converting to Swing
  • Good Luck.
     
    Sam Smoot
    Ranch Hand
    Posts: 238
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I did..
    Still Lost...
     
    Sam Smoot
    Ranch Hand
    Posts: 238
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Ok, so what does this mean? (where can I find the information to look this up?) I could probably figure this out if I just knew where to find this information (error messages).
    Thanks.
    java.lang.ClassCastException: DisplayOptionGroupApp
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:548)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:477)
    at sun.applet.AppletPanel.run(AppletPanel.java:290)
    at java.lang.Thread.run(Thread.java:536)
    p.s. I'm not always this dense, just have a lot of procedural coding background to push out of the way....

    [ May 14, 2002: Message edited by: Sam Smoot ]
     
    Sam Smoot
    Ranch Hand
    Posts: 238
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Helps when you don't delete the extends JApplet call.
    Now I have a blank gray screen... One step in the right direction.... now for 3 backwards...
    [ May 14, 2002: Message edited by: Sam Smoot ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic