Solved

how to run the swing program

Posted on 2001-06-12
7
428 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
noX challenge 17 77
parentbit challenge 3 52
nestparen challenge 4 57
micro services vs rest web services 16 53
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

744 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

11 Experts available now in Live!

Get 1:1 Help Now