aspose file tools*
The moose likes Beginning Java and the fly likes Opening link in new window with  java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Opening link in new window with  java" Watch "Opening link in new window with  java" New topic
Author

Opening link in new window with java

venkateswara reddy
Greenhorn

Joined: Dec 03, 2003
Posts: 4
Hello Friends,
If any body knows how to open a link in a new window using java please let me know.

Thanks in advance.

venkat
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Could you be a bit more specific about your problem? I assume you're referring to a "link" on a web page, but what do you mean by "opening a new window with Java?"


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
venkateswara reddy
Greenhorn

Joined: Dec 03, 2003
Posts: 4
Runtime.getRuntime().exec(rundll32 url.dll,FileProtocolHandler http://www.rediff.com?);

This is the code what I am using for launching the browser it is working fine but problem is it is using the already opened browser(if I already opened one link manually).
I want to open in a new browser that is the problem.

so if you know how to do it please let me know.

thanks in advance.

regards
venkat
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Ok. The solution has nothing to do with Java (nor web services), so someone will probably soon move this thread into another forum.

In the meanwhile, I'd suggest finding documentation regarding the DLL you're using.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I decided to Google for url.dll and quickly came up with the following pages you might want to read through:
http://www.jsiinc.com/SUBI/tip4100/rh4162.htm
http://forum.java.sun.com/thread.jsp?thread=28192&forum=17&message=69226
http://java.sun.com/developer/qow/archive/15/index.html
http://browserlauncher.sourceforge.net/
http://www.javaworld.com/javaworld/javatips/jw-javatip66_p.html
http://ostermiller.org/utils/Browser.html
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Moving this to Java in General forum.
Please continue this discussion there...
S. Lohi
Greenhorn

Joined: May 21, 2004
Posts: 11
Opening a new window with javascript:

<script type="text/javascript">
function openwindow()
{
window.open("url.goes.here", "name_of_the_window", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=x, height=y")
document.write(page)
}
</script>

<a href="javascriptpenwindow()">Link</a>

Where:
x is width in pixels (a plain number),
y is height in pixels (-"-).
If you don't know what those options mean try changing some to yes to find out.

Hope this helps.

SLohi

[ May 21, 2004: Message edited by: S. Lohi ]
[ May 21, 2004: Message edited by: S. Lohi ]
Philip Norman
Greenhorn

Joined: May 24, 2004
Posts: 1
Hello!
The code you want in this instance is

to use a simple example. This opens a new Internet Explorer window and directs it to the url it has been given.

Hope this helps,
Phil - Celebrating my first post here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening link in new window with java