Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 22nd, 2005, 02:28 PM
Registered User
 
Join Date: Aug 2004
Location: Westlake Village, CA, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't get the first example to work

Hi,

I just started "Beginning Java 2" and I am trying to get the applet in the first example to run. When I execute "appletviewer MyFirstApplet.HTML", the window pops up, but I get the message "applet not inialized" at the bottom.

In the command box, I get a bunch of message, starting with
java.lang.ClassFormatErro: first1 (Bad magic number)

Here is first1.class:

import javax.swing.JApplet;
import java.awt.Graphics;

public class first1 extends JApplet
   {
   public void paint(Graphics g)
      {
      g.drawString("To climb a ladder, start at the bottom rung", 20, 90);
      }
   }

===========================================
Thanks for any help.

Michael
Reply With Quote
  #2 (permalink)  
Old July 22nd, 2005, 03:36 PM
Registered User
 
Join Date: Aug 2004
Location: Westlake Village, CA, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I figured it out.

I didn't realize the class file was the compiled object and not the source file. I just renamed the source to ".Java" and compiled it.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 Ctrl+F5 don't work, F5 does work? jimboak BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 June 29th, 2008 03:46 AM
why it doesn't work sangfroid C# 2005 2 January 21st, 2008 02:38 PM
Able to Get it work !! rsrika C# 2005 0 March 8th, 2006 09:16 AM
Why this example doesn't work DietCoke ASP.NET 1.0 and 1.1 Basics 3 November 29th, 2004 01:17 AM



All times are GMT -4. The time now is 10:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.