Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Links in applet

  Asked By: Manju    Date: Aug 30    Category: Java    Views: 599
  

I'm new in Java, and I need help, Can I put links (HREF / ANCHOR TAG) in
applet?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Hayden Evans     Answered On: Aug 30

you can but you can't add links  with html tags i know.
You must it in source code of java.

 
Answer #2    Answered By: Sairah Hashmi     Answered On: Aug 30

This is not possible as per my knowledge but you can have a groups of labels
with arranged in a grid layout one below the others or next to each other.

On these labels you can trap the mouse events using MouseListener interface.
In the mouseClicked(MouseEvent me) method you can then know which is the
source label from which the event was generated using the me.getSource()
method.

Now that you have trapped the associated link you can use the URLConnection
class from the java.net.* package and open a new browser or may be show in
the same browser the output by reading the resource links  data.

If want to know more abt URLConnection class refer the Book
Networking by Oreilly Publication.

There is a small code given to trap & click event on applet  and open an html
page on the browser.

 
Didn't find what you were looking for? Find more on Links in applet Or get search suggestion and latest updates.




Tagged: