• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

Java and browser windows

Fungrim said:
No. The applet context represents, surprise, the context in which the applet is run.
And it didn't occur to anyone to fake up the applet context in a standalone application so that it would be easier for a program to run both ways?

Thanks to everyone! I believe I've got it working, using showDocument() in an applet and exec() when run standalone. Stay tuned for my final report.

~~ Paul
 
Will Eclipse let me use my own editor?

Erm, not entirely sure what you mean. If you mean you've got 15 years invested in vi or something, well yeah, you can use it with Eclipse but you don't get many benefits from it. Most of the advantages of Java development with Eclipse come from the automatic highlighting of problems and potential problems in the in-place text-editor. You'd just end up saving in one and looking at the other to see what's happened.
 
If I had 15 invested in vi, I'd be a gibbering idiot. But I do have 15 years invested in Epsilon. I never enjoy using devo environments with their own editors.

Of course, I debug by inserting trace statements, so you can laugh and call me names without fear of reprisal.

~~ Paul
 
If I had 15 invested in vi, I'd be a gibbering idiot. But I do have 15 years invested in Epsilon. I never enjoy using devo environments with their own editors.

Well I've never heard or used it. You can only try Eclipse and see if you like it. I find it makes Java development a lot easier - it has a lot of nice features that just help.

Of course, I debug by inserting trace statements, so you can laugh and call me names without fear of reprisal.

Hardly. Nothing wrong with debugging statements. Often the simplest way of doing it.
 
And it didn't occur to anyone to fake up the applet context in a standalone application so that it would be easier for a program to run both ways?
No, that doesn't sound like a particulary good sollution. It isn't the same functionality. In the applet you ask the current browser to display a URL. In the standalone you ask the system to open a new browser and display a URL. Which browser? Create a context for the application which later can be fulfilled either by the applet context or a system utility class depending on runtime placement. Or create a "show help utility" or...

Anyway, glad it worked.
 
The user's default browser, no? I have lots of standalone apps that open browser windows.

My hybrid scheme seems to work great on my Windows system, but not on another person's Mac. So, as usual with Java, it's write once, debug everywhere.

~~ Paul
 
Could it be that you've only run it as an applet from localhost? It might be a permissions issue rather than a browser issue. Applets are allowed to open files on the server that hosts them, but not on the client (exception, in the localhost instance, the client is the server).
 
The user's default browser, no? I have lots of standalone apps that open browser windows.
I dare say that's on windo$e, yes? Unfortunately it doesn't hold for every other operating system, like Mac, Java needs to run on. I don't know any trivial way of opening browsers across platforms. And the only quick fix for displaying HTML docs I can think of is to embedd a small browser (IceSoft, JRex, JBrowser etc.) but that's not entirely pretty.
 
Okay, now I'm totally confused. Fungrim, why did you recommend showDocument() if it doesn't actually work? Can you explain this to me in small words?

It's an applet! It's running in a browser! I just want to open another page in the already-running browser! Why is this rocket science?

~~ Paul
 
It isn't. But you said this application is running as an applet and standalone. The method "showDocument" does not work outside a started applet. You further said that you then use "exec()" (which I assume is "Runtime.getRuntime().exec(String)") when it is standalone. After which you said...

The user's default browser, no? I have lots of standalone apps that open browser windows.
... which I commented on. As it mentions standalone apps, I assumed you were talking about the Runtime.exec(String) method of displaing a document in a browser and not the applet method. Otherwise I afraid it is me thart's confused (may still be mind you).

So: AppletContext.showDocument(URL, String) should work fine when the app is running as an Applet. When, however you're running as a standalone it isn't as easy, hence my above comment. Erhm... Better?
 
Nope, not your problem Fungrim. It was I who confoosed myself. Sorry to get hot and bothered. I'm so annoyed that this stoopid obvious method doesn't work.

The class I borrowed does various combinations of exec() depending on the host. Perhaps the magical combinations are not correct.

~~ Paul
 
No probs. It is easy enough to heat up when code doesn't work. In any case, I take it Java isn't your primary language; you know were to find me if you have more problems (I might not be able to solve them of course, but that's another issue). Best of luck.
 
This is the first application I've ever written in Java:

http://www.lecb.ncifcrf.gov/~toms/papers/ev/evj/

It is also the first GUI application I have ever written. It is also the first Web-based application I have ever written.

Everything else I've written in the past six years was written in my own programming language. There you have my complete confession, folks.

~~ Paul
 
Frankly I'm more interested in your own language. Care to elaborate on it?
 
Oh, you don't want to know.

It's called Gossip and it's layered on TAWK, which is an enhanced version of AWK. The compiler translates Gossip source into TAWK source, making use of an extensive run-time library written in Gossip.

I mostly write small and medium command line utilities for my book production business, so it's perfect for that. I'm not much of a GUI guy.

~~ Paul
 

Back
Top Bottom