This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Applets and the fly likes detecting browser name/version from an Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Applets
Bookmark "detecting browser name/version from an Applet" Watch "detecting browser name/version from an Applet" New topic

detecting browser name/version from an Applet

Karen Parker

Joined: May 16, 2001
Posts: 15
Does anyone know whether it's possible for an applet to detect the browser it is being run in? I have an applet that needs to know whether the user is browsing with Netscape or IE. I know that I can find this out with Javascript and then pass it as an applet parameter, but I'm hoping there's a way to do it from within the applet as well.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

I think you're going to have to pass it as a parameter from JavaScript... I know of no way for the applet to detect what kind of browser it is running in...


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Karen,
Try the code below to see how it can be done.

Rohit Agarwal

Joined: Jul 13, 2001
Posts: 9
Concurring with the same topic. Where do the output of the System.out.println in an applet go to. I cant see them on the browser nor in the java console
Also, can we find out which operating system i am running too?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121


Pretty snazzy!


System.out.println should be printing to the java console in the browser, or to the command-prompt window that launched the browser ( for appletviewer and Unix-related browsers ).

You can get the OS by using

Look in the Java API under the System class, getProperties() method for more.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: detecting browser name/version from an Applet
It's not a secret anymore!