Solved

Click a button then go to a specified site ?

Posted on 2002-04-19
4
166 Views
Last Modified: 2010-03-31
Could any one please show me the code that when I click on a button : my Internet Explorer will run and it will go to a specified site, such as : www.experts-exchange.com
Thank
Bye
0
Comment
Question by:kianh
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Venci75 earned 50 total points
ID: 6953406
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler http://www.experts-exchange.com");
0
 
LVL 2

Expert Comment

by:vasan_sr
ID: 6953420
Hi,
  just use the following Code
 
1. <input type=submit value=click onclick="javascript:window.open('http://www.experts-exchange.com')">

      the above code will open in a new window as such

2. if u want to give window width and height u can use the following code
 
<input type=submit value=click onclick="javascript:openwin1()">
<script language="JavaScript">
function openwin1(){
window.open("http://www.experts-exchange.com",""," width=500, height=300,top=25,left=25");
}
</script>
 
0
 
LVL 6

Expert Comment

by:valipotor
ID: 6953663
Venci75 , your method will only work on Windows machines, it's too specific. This is not the purpose of Java.
0
 
LVL 9

Expert Comment

by:Venci75
ID: 6953688
As you can see - he said - Internet Explorer
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet example 17 53
hibernate jars 4 45
How to determine if a string is a valid SHA value 7 36
jboss 7.1 start up error 1 42
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question