![]() |
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?
|
You can't. HTML needs an object embedded into it, but JFrame isn't interpretable. Use an applet instead.
|
Care to explain?
|
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 |
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? |
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. |
| All times are GMT +1. The time now is 05:40 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.