Solved

Swing Applets

Posted on 2000-02-29
4
332 Views
Last Modified: 2013-12-29
Hello to everyone,
I'm new to swing and I have problems running swing applets. When I open the
browser I get an 'class not found' error. Do I have to declare a
classpath? But in this case, how can other people see my applets over the
internet?

Thanks
0
Comment
Question by:kkarnez
4 Comments
 
LVL 8

Expert Comment

by:diakov
ID: 2568549
Copy the swingall.jar to the directory of your applet. Add it as a value in the archive entry of the applet tag. Like this:

<APPLET CODE=MyApplet ARCHIVE=mycode.zip,swingall.jar width=300 height=300>

where mycode.zip is the archive of the swing applet.

Cheers,
  Nik
0
 
LVL 7

Expert Comment

by:vladi21
ID: 2568576
look!
java Faq:

  (Sect. 11) How can I run Swing technology-based code in a browser?
   Most current browsers have to be specifically set up to run Swing applets.
  Read the article at
  http://java.sun.com/products/jfc/tsc/web/applets/applets.html for information
  about this. The article also contains a simple Swing example applet, so you
  can confirm that that's your problem.
  Another approach is to use the Java plug-in, which automatically gives Swing
  technology in the browser. See
  http://java.sun.com/products/jfc/tsc/swingdoc-current/java_plug_in.html
  http://java.sun.com/products/plugin
  http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/win.html

  HTML Converter Features
  http://java.sun.com/products/plugin/1.2/features.html
 


---
Make Swing always available from Netscape
To be able use Swing classes (without download delay) from Netscape, copy Swing JAR files (swingall.jar) in the PLUGINS directory and restart Netscape. This Ok with pre-Java 2 Swing. With that version you need the Java plug-in to be able to use the swing classes.
--
Detect which version of Swing is installed
http://www.codeguru.com/java/articles/566.shtml


Running Swing Applets
http://java.sun.com/docs/books/tutorial/uiswing/start/swingApplet.html

-----
No, swing is not a part of JRE1.1.x. you can download the swing package sepertaley from http://java.sun.com
i.e swingall.jar package that contains all the swing classes.

there r the options for u,
1. Install SWING(put swingall.jar in the users classpath) in the clients machine

2. Install JRE2 (with Java Plug-in enabled) on the users machine & invoke ur applet using the plg-in. you need to use <OBJECT> & <EMBED> tags to do this. chk out the HTMLConvertor available at http://java.sun.com . This HTMLConvertor will convert ur HTML file to include <OBJECT> & <EMBED> tags

3.Include <APPLET CODE="mySwingApplet" ARCHIVE="swingall.jar" WIDTH=300 HEIGHT=300></APPLET>
the archive swingall.jar. 'cos of this every time ur applet is loaded swingall.jar gets downloaded to the users machine. This makes the whole process very slow 'cos swingall.jar file's size is i the range of 2.5mb.
But you can include only classes used by your applet.(try make it witj JAX. JAX reads class files, analyzes them, and generates a compressed ZIP file as output
http://www.alphaworks.ibm.com/formula/JAX)


0
 

Accepted Solution

by:
vishwanathn earned 50 total points
ID: 2573248
Have you go the plugin for swing applets.

what is the browser you use?

You need to convert your html file witht he embed tag so that the plugin gets invoked.
0
 

Author Comment

by:kkarnez
ID: 2574053
Sorry vladi21, by a mistake I didn't give you the points. Answer the 'foo question' and the 50 points are yours...
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now