?
Solved

how to run the swing program

Posted on 2001-06-12
7
Medium Priority
?
436 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
[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
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 28

Accepted Solution

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

Assisted Solution

by:yongsing
yongsing earned 80 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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 …
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

764 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