hey can someone please help me with this thing?
I wanna open a link when someone clicks on a button
how can I do that?

Recommended Answers

All 3 Replies

Does this refer to a web application and JSP? If yes, put an onclick event at the button and then call this:

window.location.href="your url"

For more information read some tutorials here: http://www.w3schools.com/default.asp

Im using a Java Applet

Add an ActionListener to your button. Then in the action performed method get the AppletContext and call showDocument with the url and the target (_blank, _self...)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.