Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2008, 02:42 PM
Member
 
Join Date: Jul 2008
Posts: 3
lemon3 is on a distinguished road
launch a browser with a button
Hi, i just started java and try to make a button that launches
a web-browser with a predefined url... in netbeans. does anyone
knows how to do that?
i imported java.awt.Desktop, and tried to put some method
in the button when it clicks.. but i dont get it to work..
does anyone know where to put the classes and methods
and what they should look like
can anyone help me??
this is my first java program btw


thanks, and good luck
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-07-2008, 06:49 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,556
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
This is not specific to NetBeanse either.

First you have to add a button to a container(It's your choice, you can use a JFrame, JDialo, etc.) On NetBeans adding a button is so easy.

Then add a click even to the button. Simply double click on the already added button. You can see that auto generated click event.

As the final step what you have to do is, execute the browser with the specified URL. This implementation already discussed few times here in our community. Search the forum.

Good luck.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser Jessie Madman AWT / Swing 19 06-11-2008 01:00 PM
how to get url from browser srinivas reddy New To Java 0 02-08-2008 08:46 AM
Launch native app inside a JFrame??? benedums Advanced Java 1 08-07-2007 08:16 PM
launch a desktop icon program command avaj987 New To Java 3 08-03-2007 12:40 PM
stop button in the browser Peter Java Servlet 2 07-04-2007 08:21 AM


All times are GMT +3. The time now is 03:08 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org