The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
July 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

It works

Posted by jigar shah on July 22, 2000 at 11:48 AM

I am using Win98 with JDK1.2 and it does work.
If I simply specify class name in JView then I will see Applet with width and height equal to zero. I have to resize the applet to see the drawn strings.

But if you specify html file that has height and width define for this applet, then you will see correct view of applet.

jview /a index.html


Try avoid using JView, it's microsoft version of JVM. Use appletviewer from Sun that comes with JDK.

- Jigar

> Here is the sample applet code which compiles but which
> does not start up the appletviewer:

> import java.applet.Applet;
> import java.awt.*;
> public class Confuci extends Applet
> {
> public void paint (Graphics page)
> {
> page.drawString ("Forget injuries, never forget kindness.",50,50);
> page.drawString ("-- Confucius.",70,70);
> }
> }

>
> I tried to work the above Applet program without the IE or
> netscape navigator browsers. The applet compiles when I enter:
> C:>javac Confuci.java

> The next line is:
> C:>jview /a Confuci

> At this point I expected the dos-prompt,in which I work, to compile(which it does) and open an application window and run the
> applet. - It doesn't! Instead, without exibiting any errors, it goes to the c-prompt:
> C:>

> I want to run this applet and see the drawString method in
> action - Can you provide me with some insight into what's going on? The operating system is Windows NT 4.0, and the java version I'm using is jdk 1.2.2.

> Also, I tried to view Thinking in Java on the internet.
> I'm having difficulty in doing so. I'd appreciate any help in this matter as
> well.
> Thanks in advance for the assistance.
> Anil






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us