By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,078 Members | 2,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,078 IT Pros & Developers. It's quick & easy.

How to have button launch web page

P: 5
I am trying to figure out how to click on a button and have it open a web page. I am not asking for the logic to handle the click. Moreover I am looking for the logic that I need to run to actually launch the web page. I have found quite a bit of documentation talking about how to open a file using a URL but almost none talking about how to have a button launch to a web page. I want to code a button to a specific web page and then open it if you click on that button.
Jun 26 '07 #1
Share this Question
Share on Google+
6 Replies


10K+
P: 13,264
I am trying to figure out how to click on a button and have it open a web page. I am not asking for the logic to handle the click. Moreover I am looking for the logic that I need to run to actually launch the web page. I have found quite a bit of documentation talking about how to open a file using a URL but almost none talking about how to have a button launch to a web page. I want to code a button to a specific web page and then open it if you click on that button.
Where is this button supposed to be on?
A JFrame? An applet? Another web page?
Jun 26 '07 #2

P: 5
Where is this button supposed to be on?
A JFrame? An applet? Another web page?
I am building a web page using Sun's Java Studio. I have a grid panel which I am planning on using as a navigation bar (it will be on the left side). In this I know I can put hyperlink objects that will launch a web page. But I am trying to make it appear as buttons in order to delineate between each entry - vs having just the words. It will, also, make for a larger space on which to click. I suppose, if I could figure out how to outline the hyperlink object I might accomplish my goal. But I figured it couldn't be all that hard to have a button launch a web page - and it appears I may be wrong there.
Jun 26 '07 #3

P: 5
I am building a web page using Sun's Java Studio. I have a grid panel which I am planning on using as a navigation bar (it will be on the left side). In this I know I can put hyperlink objects that will launch a web page. But I am trying to make it appear as buttons in order to delineate between each entry - vs having just the words. It will, also, make for a larger space on which to click. I suppose, if I could figure out how to outline the hyperlink object I might accomplish my goal. But I figured it couldn't be all that hard to have a button launch a web page - and it appears I may be wrong there.

I figured out how to get an outline on my hyperlink entries. But I would still like to know the correct method for having a button launch a web page.
Jun 26 '07 #4

10K+
P: 13,264
I figured out how to get an outline on my hyperlink entries. But I would still like to know the correct method for having a button launch a web page.
You still haven't answered my question you know.
Jun 27 '07 #5

P: 5
You still haven't answered my question you know.
Oops - you are correct. The button would be on a panel grid that would sit within a web page.
Jul 1 '07 #6

10K+
P: 13,264
Oops - you are correct. The button would be on a panel grid that would sit within a web page.
So you have an applet? Use the actionPerformed method to open the page.
Jul 2 '07 #7

Post your reply

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