Solved

how to run the swing program

Posted on 2001-06-12
7
434 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 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Technology Partners: 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!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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 …

726 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