Opening HTML file from java GUI
Can someone please tell me how I can open a HTML file in Internet Explorer from a Java GUI,
I have an asssignment I am doing for college and I was toying with the idea of putting in helpfiles, for the program, can anyone tell me the easiest way of apcomplishing this???
Thanks in advance for your help,
Kaspah
Although this should answer your question, there are other (cross platform) ways to do what you want. As opposed to your "must have internet explorer" solution. Swing has a built in html viewer you might use, for example. I've been doing some reading on java/xml solutions. I don't consider myself knowledgeable enough (yet) to comment on that solution though. A delimited text file would be another solution. Useing that solution you could treat the file like a set of parrallel arrays on the hard drive and disply your text on pre-formated labels. Anyway, here is a link to you answer......
http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Runtime.html#exec(java.lang.String)
Ron_W
Similar Messages
-
Execute html file from java code - urgent!!!
Hi,
I need help!!
My application should open html file that located in my computer
it should be open when some line in JList was choosen
my question is: How can I open html file from my application
I work with window XP
I tried this one :
Runtime.getRuntime().exec(cmdLine);
but it doesn't work
the exeption was: CreateProccess
Please help! it's urgent!!!!http://forum.java.sun.com/thread.jsp?forum=31&thread=497600
-
Hi,
I need to open html file from applet, the html file is placed in my local system, it is not open. the code is below, please can u tell where i did wrong.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
<applet code="Resource.class" width="400" height="400"></applet>
public class Resource extends Applet implements ActionListener
Button b = null;
public void init(){
b= new Button("Click");
add(b);
b.addActionListener(this);
public void actionPerformed(ActionEvent ae){
try
URL adress = new URL(getDocumentBase(), "html_code.htm");
getAppletContext().showDocument(adress, "_blank");
System.out.println("Execut inside"+adress);
}catch(MalformedURLException e){
System.out.println("Eror in Display");
}Don't cross post
http://forum.java.sun.com/thread.jspa?threadID=633500 -
Write HTML Files from java application
Hello,
i have to write HTML files from a java application.
I am asking if anybody can give me a hint about a good simple solution (library) which can do some of the job for me.
i know FOP for example is good to create pdf or html from xml, but i dont want to go via xml.
the sites i need are really very simple presents emails.
body and maybe a link for next and pervious.
however, thank you in advance.
a little hint will also help :)
Sako.That, too, is my question.
Be the "server" local or remote, wouldn't JSPs still
be the easier solution? No. it will not. because you need a server. Server for a stand alone application is not esier. according to who said JSPs are easy?
Its very very difficult.
>
When answering, please clarify. I'm a bit of a newbie
here. :)To get sence about how hard is JSP, check Struts. this is very good open source Framework to simplify the JSPs. but it still complecated enough.
or Tapestry my lovely open srouce Framework.
its easier than Struts. but sill complecated because of the documentation.
All in all, using JSP is the purpose of Java in the internet. but not for me. My application will not be available in the internet, i.e. no server, i.e. no need for JSP.
i hope that helps a little. -
How to run .html file from .java file..?
Hi All,
I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
Thanks in advance.viswa07 wrote:
You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
[This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
db -
can i open servlet file from java
do you mean linking to a servlet from java application?
have you try this?
URL toServlet = new URL("URLtoServlet");
URLConnection servletConnection = toServlet.openConnection(); -
Can I Open an HTMLHelp (*.CHM) File from Java GUI Application?
I ussually use Delphi to develop my applications and I can open an HTMLHelp (*.CHM) file from my application. Can you show me the ways to do it from my Java GUI applications?
Thanks for everyone.
Budi Raharjo
http://budiraharjo.blogspot.comhttp://www.google.com/search?q=java+chm
Seems like there is some 3rd party software available for that. -
Can't open HTML files from local or remote location
Hello Experts,
I've tried deleting my remote location, and adding it back
again several times and I still can't open any HTML files. I can
check out the pages, and check them back in, but nothing shows up
on the screen. Does anyone know what may be causing this? I'd
really like to update my website soon. If I click on the web images
they open up in my photoshop, it's just the Dreamweaver HTML
portions that won't open up.
Thank you,
Calie> Unfortunately I can't seem to get any of the pages open
to check out the code
> view.
CLARIFY please.
You said you open them, but design view is blank.
The file is either open or not open
Is the file open? And design view is blank? Or is the file
NOT open and
there are error messages?
If the is open, even if empty design view There should be
something in code
view.
some not random attempts at fixing this:
open dreamweaver.
Open this site.
DON'T open any files.
open find and replace
Find in Source Code, sitewide:
<!-- -->
replace with: [nothing]
reason: not much of one, but I've never seen an empty html
comment. It
doesn't need to be there.
Then, i'm trying to think of a way to fix this badly nested
bold tag
<p><b>
<a href="about-me.html">ABOUT ME</a> |
<a href="contact.html">CONTACT</a> |
<a
href="
http://blog.loveBaRKLee.com/">BLOG</a>
</p></b>
the closing </b> needs to be moved to before the
closing paragraph tag.
My next guess is that it's a css problem-
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.lovebarkle
e.com%2Fdog-bed-accents.html&profile=css21&usermedium=all&warning=1&lang=en
moz-radius
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.lovebarklee.com&charset=%
28detect+automatically%29&doctype=Inline&group=0
Fix the errors, clarify if the file does or doesn't open in
dreamweaver, if
it opens and design view is blank or if it doesn't open and
crashes the app.
moosepucky.
Alan
Adobe Community Expert, dreamweaver
http://www.adobe.com/communities/experts/ -
Opening .doc files from Java
Ok, here's my problem.
I'm using Java to create an autorun program for a little thing I'm putting together.
One of the options should be "Read documentation" . However, to do that, I need to make my program open a Microsoft Word (.doc) document. What is the command/how can I do this? By open, I mean open the file in MS Word for viewing.When you say "where filename is the path" do you mean
type in "\documentation\file.doc" or is it a variable?It's a variable in the example. It doesn't matter -- just as long as the resulting string passed to exec will contain the correct file name so the OS will see it. -
How to open an PDF file from Java Application
Hi
I am developing a GUI application in java swing.
on clicking one button, I want to open PDF file from my swing application.
Is there any API through which I can achieve this?
Tapan Maru
Sun Certified Java ProgrammerHere's a way to do it (if I understand you
correctly). Just let explorer.exe do it for you.
import java.awt.*;
public class openPDF
Desktop desktop = Desktop.getDesktop();
public openPDF()
open("test.pdf");
public void open(String path)
try
Runtime.getRuntime().exec("explorer.exe "+path);
} catch(Exception e) { System.out.println("NAI!
I! ERROR!\n"+e); }
public static void main(String[] args)
openPDF myApplication = new openPDF();
Why do you have a Desktop object as a member but instead of using it, you execute a command with Runtime (which is not platform independent!)???
-Puce -
How Can i open Html file in a Browser from Jar file
Hi
i am having Html help files inside my Jar file ... if i use
getclass().getRource("\lib\start.html");
it is not opening ... so i have to ship seperate folders for html files along with jar files.... can anyone give the solution to have(open) html files inside the jar file and to open then in a default browser of any OS
Regards
Ganesan Sthe follwing method i have used to open html file ...
so to access html file i am shipping resources folder with jar file ..
private void openHtmlPages(String pageName) {
String cmd[] = new String[2];
String browser = null;
File file = null;
if(System.getProperty("os.name").indexOf("Linux")>-1) {
file = new File("/usr/bin/mozilla");
if(!file.exists() ) {
}else {
browser = "mozilla";
}else {
browser = "<path of iexplore>";
cmd[0] = browser;
File files = new File("");
String metaData = "/resources/Help/Files/"+pageName+".html"; // folder inside jar file
java.net.URL url = this.getClass().getResource(metaData);
String fileName = url.getFile();
fileName = fileName.replaceAll("file:/","");
fileName = fileName.replaceAll("%2520"," ");
fileName = fileName.replaceAll("%20"," ");
fileName = fileName.replaceAll("jarfilename.jar!"," ").trim();
cmd[1] = fileName;
try{
Process p = Runtime.getRuntime().exec(cmd);
}catch(java.io.IOException io){
//Ignore
can anyone give me the solution..???
Regards
Ganesan S -
Whenever i try to open any HTML file from my computer, it opens a new firefox window which is blank. Facing this problem after the new update. please fix this problem
I found that after Firefox v29, a LOT of my settings and<BR>
add-ons were changed / reset. Try this;
'''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]'''''
<BR>While you are in safe mode;<BR>
'''''Firefox Options > Advanced > General'''''.<BR>
Look for and turn off '''Use Hardware Acceleration'''.<BR>
Then check ALL of your settings. Browser and add-ons. Then restart. -
How to open a file from thumbdrive by Java!
Can anyone reply me the Java sample code to open a file from thumbdrive. Currently I can only open files from my "C"Drive. The Drive which I will be using for my thumbdrive is F Drive.
Thank you!Currently I need to make changes to this code so that it can read the "my file" from my f drive instead of the c drive.
/public class Main {
public Main() {
public static void main(String[] args) {
try {
//Runtime.getRuntime().exec("cmd /c start myfile.doc");
//Runtime.getRuntime().exec("cmd /c start \"myfile.doc\"");
Runtime.getRuntime().exec("cmd /c start myfile.pps");
//Runtime.getRuntime().exec("cmd /c start myfile.xls");
//Runtime.getRuntime().exec("cmd /c start myfile.pdf");
//Runtime.getRuntime().exec("myfile.doc");
catch (Exception x) {
x.printStackTrace();
catch (Error e) {
e.printStackTrace();
} -
When I open an html file from the desktop all I see is source code rather than webpage.
I have tried clearing the cache and reading other questions similar. I have a mac and am opening these files from the desktop, not a server or anything so It's incredibly annoying that firefox wont open them as html files even though that is what they are saved as. Also there is no .txt after them. They are purely .html files.
Try to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
*http://kb.mozillazine.org/mimeTypes.rdf
*http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions
Firefox 16.0.2 is the last version that works on an Intel Mac with the OS X 10.5 operating system.
* https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/16.0.2/mac/
Another option to consider is to install the last Firefox 10.0.x ESR version as that version is more recent than the Firefox 16.0.2 version.
* https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/10.0.12esr/ -
Hi,
I need some help.
Product=weblogic5.1.0
Revision=(Release Level)=
Problem Description=
I am doing cluster of weblogic server, I have no problem to set up the
cluster and to run servlet and EJB examples.
However, on my command line for startcluster I got a lot of message as
followed:
Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
error: java.lang.RuntimeException: I/O error opening JAR file from
file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
.java, Compiled Code)
at
weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
StreamBase.java, Compiled Code)
at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
jectInputStreamBase.java, Compiled Co
de)
at
weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
treamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
tStreamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
eamBase.java, Compiled Code)
at
weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
treamBase.java, Compiled Code)
at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
The message freshed about every 20 seconds.
Another question, I used a iplanet web server as a proxy server with a
cluster of two weblogic servers pluged in, although I set
weblogic.properties to round-robin, however, when I run a fibonacci servlet,
it does not do the round-robin. It always go to one machine for a lot of
times. Any idea?
Thank you for your help.
Tom
May i presume that your cluster is configured on a shared file system?.
I have seen this problem only if you cluster is configured on different machines
and if the directory structure is not identical.
let us know..
Kumar
Cameron Purdy wrote:
> First, update to SP4 (or SP5 if it is out now). Second, follow the cluster
> instructions on setting up deployments for a cluster. The only
> implementation that I have used is the single shared location that all the
> servers load from.
>
> --
>
> Cameron Purdy
> http://www.tangosol.com
>
> "Tom Gan" <[email protected]> wrote in message
> news:[email protected]...
> > Hi,
> > I need some help.
> >
> > Product=weblogic5.1.0
> > Revision=(Release Level)=
> > Problem Description=
> > I am doing cluster of weblogic server, I have no problem to set up the
> > cluster and to run servlet and EJB examples.
> > However, on my command line for startcluster I got a lot of message as
> > followed:
> > Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket
> receive
> > error: java.lang.RuntimeException: I/O error opening JAR file from
> > file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
> > java.util.zip.ZipException: error in opening zip file
> > at java.util.zip.ZipFile.open(Native Method)
> > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
> > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
> > at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
> > Compiled Code)
> > at
> >
> weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
> > .java, Compiled Code)
> > at
> >
> weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
> > , Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
> > jectInputStreamBase.java, Compiled Co
> > de)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
> > tStreamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
> > eamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
> > StreamBase.java, Compiled Code)
> > at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
> > Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
> > jectInputStreamBase.java, Compiled Co
> > de)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
> > tStreamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
> > eamBase.java, Compiled Code)
> > at
> >
> weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
> > treamBase.java, Compiled Code)
> > at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
> > Code)
> >
> > The message freshed about every 20 seconds.
> >
> > Another question, I used a iplanet web server as a proxy server with a
> > cluster of two weblogic servers pluged in, although I set
> > weblogic.properties to round-robin, however, when I run a fibonacci
> servlet,
> > it does not do the round-robin. It always go to one machine for a lot of
> > times. Any idea?
> > Thank you for your help.
> > Tom
> >
> >
> >
Maybe you are looking for
-
Volume doesn't work on iPod touch
The volume isn't working on my iPod.
-
Magic Mouse left right swipe not working
I got the mouse with my computer about a month ago. And suddenly, the left/right swipe has stopped working. I've wiped down the top and changed the batteries. I restarted. It doesn't seem to be working. Has anyone else had this problem? Does anyone k
-
I am rying to modify an existing project by adding new pictures, i can drag them fine into the project, but in reality they appear as a black space later, looks like the project rejects them. Any idea?
-
Need help with C++ native extension for Android
Hello! I'm trying to build and launch sample native extension written with C++ on Android device. But thre I have: 1) Code of native library: #include "FlashRuntimeExtensions.h" #include <stdint.h> #include <stdlib.h> #include <string.h> FREObject na
-
Are swatch files color managed?
I can use Adobe Swatch Exchange to save a set of swatches from my swatches panel and send them to someone else. Does anyone know if this is color managed? If I set up a swatch which is C27 M60 Y100 K11 when working on a project I'm intending to print