Solved

Swing Applets

Posted on 2000-02-29
4
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jdbc error in jsp application 20 91
going to wrong jsp page 2 70
add projects t working set in maven 2 72
Java array 10 89
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

752 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