473,547 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening browser from Java

5 New Member
Hi,

I want to open a browser and place it and size it as I wish,when user selects an option from the menu written in java.
I tried passing command line argument rundll32 url.dll,FilePro tocolHandler<ur l>
in windows 2000 it works fine.But in Xp it doesn't work.Can anyone help me out .

Is there any other way of invoking browser from java application or applet to open a browser which should be positioned and resized as we want(no jdic browser).?

Latheef
Jun 22 '06 #1
2 3307
tweedie
1 New Member
Oh I remember this one from one of my project I was doing that might do the trick. you basically need to pass ? at the end of the url string if the OSVersion is greater then 5.0

Expand|Select|Wrap|Line Numbers
  1. //// url variable contains the url string address ie http://www.bbc.co.uk
  2.  
  3. // If in win2k and http, the cmd must end with a "?"!
  4. float OSVersion = Float.parseFloat(System.getProperty("os.version"));
  5. if (OSVersion >= 5.0f && url.toLowerCase().startsWith("http")) {
  6.     url = url + "?";
  7. }
  8.  
  9. String cmd = "rundll32 url.dll,FileProtocolHandler " + url + "";
  10. Process r = Runtime.getRuntime().exec(cmd);
  11.  
As for the position of the browser window -- sorry, haven't a clue about that.
Jul 4 '06 #2
latheef
5 New Member
Thanks for the reply.
What I pass in cmd is:
javascript:wind ow.resizeTo(550 ,602);window.mo veTo(550,138);l ocation.href="h ttp://yahoo.com"
But it does n't work in windows XP-sp2.This one works in 2000.
Any idea!
Jul 17 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1405
by: Prasanth Dash | last post by:
I want to open the browser from a stand-alone java application. How to do it? anybody pl jelp me. thanks Prasanth
4
3128
by: zach | last post by:
Hi My problem is that on some sites when I click on a picture (for example) that is supposed to open in a new window it doesn't. The bottom left of my browser where it tells what is happening just says javascript and has a yellow triangle with an exclamation point in it. I have java enabled on my computer and tried turning my pop-up...
5
2067
by: Mark Rae | last post by:
Hi, I'm writing a web app in VS.NET 2003, part of which allows users to download reports in the form of XML documents to their local machine for further processing. I'm using a 3rd-party Java applet to do this, and it works perfectly. However, I'd like to be able to offer users the ability to view the XML documents once they've...
4
1684
by: Guern1 | last post by:
Hi Need a bit of help here please to point me in the right direction. I have a java class file here which i wish from a menu item to open a web page which contains a help page. ] } else if (arg.equals(" Help Page")) { } else if (arg.equals("BrowserControl")) {
0
7507
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.