Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2005, 02:28 PM
Registered User
 
Join Date: Aug 2004
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
 
Old July 22nd, 2005, 03:36 PM
Registered User
 
Join Date: Aug 2004
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.





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.