This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

detecting browser name/version from an Applet

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

-Nate
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karen,
Try the code below to see how it can be done.

Enjoy,
Manfred.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Rohit
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manfred,

Pretty snazzy!

Rohit,

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.

-Nate
 
A feeble attempt to tell you about our stuff that makes us money
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!