Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

running a java program on a web page

  Asked By: Aysel    Date: Nov 24    Category: Java    Views: 1884
  

How can i run a normal java program (NOT APPLET) in a browser i.e. a
java swing 'hello world' program?

Share: 

 

7 Answers Found

 
Answer #1    Answered By: Jennie Harris     Answered On: Nov 24

One Way is Using Java Web Start!
For example in JBuilder You can Do it in Wizard Manner!

 
Answer #2    Answered By: Melissa King     Answered On: Nov 24

Would you be able to show me how this is done, please??

 
Answer #3    Answered By: Clayton Richardson     Answered On: Nov 24

I am not entirly sure you can run  a java.class file in a web  browser
unless it is a applet.

 
Answer #4    Answered By: Adelinda Fischer     Answered On: Nov 24

you cannot do this. Class files are used in Java
applications - Java can interact with a web  browser either on the
client side (applet, downloaded from the server and run  in the
browser) or server side (servlet, JSP, etc). Servlets are in fact
class files that are compiled on the server side and sent back to the
browser as part of the end-product HTML (as JSPs also compile as
servlets). I think the confusion is coming from the distinction
between Java applications and Java web entities (applet/servlet).

 
Answer #5    Answered By: Tamara Nguyen     Answered On: Nov 24


yes u r true adam it's too complicated i think,
but still u can run  a non-applet java  program using an java enabled browser.
how i am telling this one is., u can check with the DEMO section of Java2
Standard Edition(J2SE). (DEMO is inside your <java_dir>\demo folder & it's
optional)
Each program  having corresponding .HTML file to execute
especially look into \demo\jfc\SwingSet2 it's completely done using Swing
components but still it's running  perfectly on my Internet Explorer6.0 on a
Windows XP machine by just double clicking SwingSet2.html file in that folder.
if anybody how to do this stuff plz explain. im also trying...

 
Answer #6    Answered By: Ujala Hashmi     Answered On: Nov 24

If by running  a java  program in a web  page you mean
the application runs within the context of the
browser, using all of its resources, I believe it has
to be an applet. applet  can open other windows, once
loaded and look like a standalone application, if
that's what you are going for.

If you mean dynamic loading of various components over
the web into a java application, then you might want
to look at the web start. You can run  any application
and you don't really need to have a browser  or a web
page at all.

 
Answer #7    Answered By: Robin Bailey     Answered On: Nov 24

I dont recommend using this tool, I think web  application is web
application and it is better to use only web application for web
programming.

but you can use Java Web Start In some cases!

If you have JBuilder, I think version 8 or more, there is a wizard in
its help namming

Tutorial: Running the CheckBoxControl sample application with Java Web
Start

I tested it for application and it worked well.But Idont know if any
other IDE has this wizard.

 
Didn't find what you were looking for? Find more on running a java program on a web page Or get search suggestion and latest updates.




Tagged: