Solved

how to run the swing program

Posted on 2001-06-12
7
431 Views
Last Modified: 2013-11-23
hi .............
how to run any swing program through internet browser.
I have one html file through which i am trying to run swing program(j.java).but not getting display japplet (j.java)through internet.5 browser.
why?
i am getting error that j.class file is not found when the j.class file is there in same directory.why?

html file :
-------------------------------------------------------
<html>
<head>
<title>uuuuuuuuuuu</title></head>
<body>
<applet code="j.class" width=200 height=200>
</applet>
</body>
</html>
-------------------------------------------------------
j.java program :

import java.awt.*;
import javax.swing.*;
//<applet code="j.java" width=200 height=200></applet>
public class j extends JApplet
{
JTextField j;
public void init()
{
Container con =getContentPane();
con.setLayout(new FlowLayout());
j=new JTextField(15);
con.add(j);
}
}

kalpana
0
Comment
Question by:rkalpana
7 Comments
 
LVL 9

Expert Comment

by:Ovi
ID: 6181232
Because is a Swing applet, and so you need to use the Java Plug-in
0
 
LVL 27

Accepted Solution

by:
rrz earned 20 total points
ID: 6182104
0
 
LVL 9

Assisted Solution

by:yongsing
yongsing earned 20 total points
ID: 6184086
You need to use the HTML converter to convert your applet tags to the format required by the Java Plug-in. You can get the converter from this site. It's actually quite simple.

http://java.sun.com/products/plugin/1.3/docs/html_converter.html
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 3

Expert Comment

by:shyamkumarreddy
ID: 6184554
Hi kalpana

U can do 2 things now


1.   Include swingsall.jar in ur archive of applet tag
or
2.   Use Java plug-in and use Object or embed tags to run the applet.

Any of the solution will work out

Shyam
0
 
LVL 3

Expert Comment

by:rjackman
ID: 6184894
hi
including swingall.jar is not the better option because browser will try to downlaod the swing classes from swingall.jar so will take a quite along time
i think u should go for the HTML converter which will convert ur HTML code so that whenever u run such HTML in ur browser it will automatically invoke the plugin required for displaying the swingclasses
cheers
RJ
0
 
LVL 3

Expert Comment

by:shyamkumarreddy
ID: 6184965
Hi

Since if the user is not interested in having a plugin then including swingall.jar is the solution right.

I talk in terms of including plug-in or without having plug-in.

is the solution i provided

Cheers
Shyam
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9027597
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[split points between yongsing and rrz@871311]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

810 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