Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-17-2012, 06:39 PM   PM User | #1
tornskyz
New to the CF scene

 
Join Date: Aug 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
tornskyz is an unknown quantity at this point
Exclamation Trying to display in a jframe an html file from my computer

Hi, i've been working on this for months and i've tried so many different things. can anyone help me with this?
tornskyz is offline   Reply With Quote
Old 08-17-2012, 07:08 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
You can't. HTML needs an object embedded into it, but JFrame isn't interpretable. Use an applet instead.
Fou-Lu is offline   Reply With Quote
Old 08-17-2012, 07:17 PM   PM User | #3
tornskyz
New to the CF scene

 
Join Date: Aug 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
tornskyz is an unknown quantity at this point
Care to explain?
tornskyz is offline   Reply With Quote
Old 08-17-2012, 07:30 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
JFrame's cannot be rendered through HTML. You need to embed an object of type applet instead.
Applet can handle a JFrame, so you just need to wrap your JFrame in an applet class instead. See this tutorial for more applet information: http://docs.oracle.com/javase/tutori...let/index.html
Fou-Lu is offline   Reply With Quote
Old 08-17-2012, 07:34 PM   PM User | #5
tornskyz
New to the CF scene

 
Join Date: Aug 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
tornskyz is an unknown quantity at this point
okay so another question:

what if i create an html file and i want to call it using:


File file = new File("insert file path");

would that work, or is the applet the only way to do it?

Last edited by tornskyz; 08-17-2012 at 07:38 PM..
tornskyz is offline   Reply With Quote
Old 08-18-2012, 04:36 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I don't understand what you are looking to do here. If you open a file with an IO handling method, you retrieve it as text. It'll only do something if you parse it and handle it in some fashion.
If you want to run it over http embeded in an html file, use an applet. If you want to handle it as server code over http, use a servlet or JSP. If you want to handle a desktop application capable of communicating over http, then look at writing a JFrame and establish http connections.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
java html combine

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:49 AM.


Advertisement
Log in to turn off these ads.