|
Hi again Sudha,
Further to my last post:
1) Forget what I said about Ostermiller vs ostermiller. I see you can't
change this as you didn't create the jar file. (Just googled and found the
jar file on the net.)
2) Having had a quick look at the javadoc, If you want to display a web
resource via the command line using this Browser class then you should
create your own class. I'd suggest something like:
import com.Ostermiller.util.Browser;
import java.io.*;
public class CallBrowser {
public static void main(String[] args) {
if (args[0] != null) {
try {
// Initialise the Browser class...
Browser.init();
// Display the passed web page...
Browser.displayURL(args[0]);
// Catch the exception thrown by Browser.displayURL(String s)...
} catch(IOException e) {
System.err.println("Browser went bang");
// Catch any other exceptions thrown within the try block...
} catch(Exception e) {
System.err.println("It ALL went bang");
} // end try...
} // end if...
} // end main...
} // end class...
I've just knocked this up quickly, so it would need tidying up (I'd suggest
allowing for a second string element, so you can specify the window to use).
However, I've just downloaded the Ostermiller jar file, compiled this class
and got it to open the URL I passed from the command line. It opened within
Internet Explorer. This was all done on my PC.
Cheers, and I hope this is of use.
Larry Ducie
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.