File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes convert frame to an applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "convert frame to an applet" Watch "convert frame to an applet" New topic
Author

convert frame to an applet

shanaya dutt
Greenhorn

Joined: Jul 02, 2009
Posts: 23
i had created my program that reads files from commandline arguments and shows the contents graphically on a frame.But now that program needs to be web enabled.So i need to convert it into an applet.How do i do that?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
What, exactly, do you mean by "web enabled"? It's easy to write an applet that pops open the application frame you already have, but applets have no notion of command line parameters. The usual way of passing parameters to applets is through "param" tags in the applet tag, but those would be hard-coded in the HTML. If you need more flexibility, you may have to add a GUI to the applet where the user can set those parameters.


Ping & DNS - my free Android networking tools app
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Moving to the Applets forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
shanaya dutt
Greenhorn

Joined: Jul 02, 2009
Posts: 23
well,the program was built so that a frame opens up when file input is directly given through the command line.However,since frames run only at the local machine,i cannot use it for web anabling the program for everyone's access.So i need to convert it into an applet.I want to save the contents of the frmae into an applet now.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
You really need to tell us what you mean by "web enabling" - you seem to use the term for more than just "put an applet on the web".

since frames run only at the local machine,i cannot use it for web anabling the program for everyone's access

What do you mean by this? What's the difference between running an application and an applet from a user's perspective? Does this have something to do with what you're referring to as "web enabling"?

Also, by "save the contents" do you mean that the applet needs to show the application frame? That's easily done - an applet has no problems opening a Frame.
shanaya dutt
Greenhorn

Joined: Jul 02, 2009
Posts: 23
Sir,I don't know any thing about "web enabling".this was the term used by my senior.My program runs from command line to take the file inputs and open a frame.What I'm required to do is to open the frame in an applet so that it can be used for the web.Thats all that i'm needed to do.
How should i go about doing this.I'm fairly new to java and not familiar with this stuff.Please guide me
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
It's trivial to open a frame in an applet; something like "JFrame myFrame = new MyJFrameExtendingClass(); myFrame.setVisible(true);" should do the trick.

Note that applets have no access to the local file system unless they're signed; see HowCanAnAppletReadFilesOnTheLocalFileSystem for more information.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: convert frame to an applet
 
Similar Threads
Why This Error??
Convert an int to a BigInteger
crating an executable jar file
Vectors
CONVERTING an application to an applet