How to check whether a default browser is opened in the operating system (Java)?

Posted by stempel1984 on Stack Overflow See other posts from Stack Overflow or by stempel1984
Published on 2010-06-07T14:07:02Z Indexed on 2010/06/07 14:12 UTC
Read the original article Hit count: 119

Filed under:

Hi,

I am newbie here. During my work, I faced an interesting problem. I need to:

  • check whether a default html browser is opened;
  • check whether the browser is minimized/maximized (simply, a window's state);
  • get an url address typed in the browser.

If any of these conditions is not met, I have to open the browser in a maximized view with a desired url address.

I primarily wanted to do all this in Java, but it came to my mind that I should employ many techniques/technologies and combine them appropriately to complete the functionality. But, which ones? That's the problem.

I just recalled Windows API, but I'm not sure if it is of any help... Some users on another forum suggested that I should consider JNI (no experience at all)... I only know how to open a default browser (e.g. with use of the 'browse(URI uri)' method of the 'java.awt.Desktop' class) - that's too little to be proud of.

Please give me some hints, maybe links to reasonable discussions, I would greatly appreciate any suggestions how to approach the problem.

© Stack Overflow or respective owner

Related posts about java