How do I determine the default browser in Windows and Linux? [duplicate] - java

This question already has answers here:
Looking for a Java User Agent String Parser [closed]
(2 answers)
Open a link in browser with java button? [duplicate]
(7 answers)
Closed 10 years ago.
I am designing small Java application and there is a webDriver in it. The application will collect information from a web service.
One of the requirements for this app is no particular browser dependency. That is, I don't know which browser is installed on the end user PC. As a result, I need to use the default browser. How do I do this?

in Windows :you can use browse(URI uri) function in Desktop class ,it launches the default browser to display uri
Desktop.getDesktop().browse("/////URI");

Related

awt & swing alternative for headless environment [duplicate]

This question already has answers here:
How to execute Java Swing code in a JSF page
(1 answer)
Creating FacesMessage in action method outside JSF conversion/validation mechanism?
(1 answer)
Closed 2 years ago.
I'm using thirdparty libraries to read data from a card reader (electronic identity cards). I implmented it in my webpage in my JSF2.2 project with maven and it runs on my local weblocic 12.2 just fine.
The libraries use awt and swing to show a GUI with status messages to the user while processing the card (e.g. "Please insert card,...).
But on our server it won't run because the server is running in headless environment. Unfortunately I can't change the servr configuration.
Is their an alternative for awt and swing libraries that I can use to overwrite the UI and that runs in a headless environment?

Using Javacode to get the actual name of the Program that is top [duplicate]

This question already has answers here:
How to get a list of current open windows/process with Java?
(14 answers)
Closed 6 years ago.
I am currently writing a Java Application, that needs to filter the name of the Program whichs UI is front. Sorry for my bad english.
So let's say the Java App is running in Background and I open Windows -> Games -> Minesweeper then i want the App to only tell me "Active: Minesweeper". Without any additional information. Just the name "Minesweeper"
I already tried using JavaNativeAccess but I'm still unfamiliar with it.
Thanks you all in advance
You might want to look at the following link which might be of help:
How to get a list of current open windows/process with Java?

Open URL with Java, then close the browser [duplicate]

This question already has answers here:
Closing a Web Browser for a specific URL from the java program
(2 answers)
Closed 7 years ago.
I'd like to open an URL in the default browser using Java. So I am doing what the answer in this question says: Open a link in browser with java button?
It works. However, I want to automatically close that browser after some 10 seconds have passed (from Java). This is for Windows machines.
How can I achieve this?
Start the process with:
Process p = Runtime.getRuntime().exec(new String[] {"explorer", "http://google.pl"});
and after your 10 sec call:
p.destroy();

How to create remote desktop access application using java? [duplicate]

This question already has answers here:
How can I display a VNC Viewer in a Java rich client (LGPL, Apache, MIT license)?
(3 answers)
Closed 9 years ago.
I have two computer in different network.I want to control one system from another.Both system have windows 7 operating system.Do any one have any idea how to do it??
I don't want to use team viewer or any other application.
VNC has been the most popular choice when it comes to remote desktop/computing. Check out this open source implementation called TightVNC, it even has a viewer application implemented in Java:
http://www.tightvnc.com/release-jviewer2.php
You can install Teamviewer into both computer.
I don't think that have a relationship with java and swing.
I think that you should correct the tags.

Using Regedit in Java [duplicate]

This question already has answers here:
Read/write to Windows registry using Java
(25 answers)
Closed 9 years ago.
How do I use regedit so as to store some deatails of my program ?
I would like to use this to store some data like the program folder, some user cofigs and also some extensions that the computer should recognize as my program's extension.
Consider using the Preferences API. Preferences.systemRoot() should let you touch the registry node at HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Prefs on a 64 bit computer with 32 bit java.

Categories