Solved

Creating hyperlinks in an applet...

Posted on 2001-06-03
8
451 Views
Last Modified: 2010-05-18
how do i make a simple String as a hyperlink in my java applet and when clicked, pass some parameters in the url to the target page??
0
Comment
Question by:sidds77
8 Comments
 

Expert Comment

by:kamalindia
ID: 6151266
Use getAppletContext().showDocument(URL) method to call the target page with parameter list


getAppletContext().showDocument("http://myserver.com/exampl1.jsp?site='javazone'");


Regards

Raj
0
 

Author Comment

by:sidds77
ID: 6151845
hi raj,
thanks. Thats after a hyperlink is created and a user clicks on that then we can load the URL in that form.
But i want to know how to create that hyperlink in the applet. for example :
String link="Click Here";
Now how do i make this String 'link' as a hyperlink so that when a user takes the cursor over this text, it acts as an hyperlink.

0
 

Expert Comment

by:rohitgautam
ID: 6152050
i will tell u in some days that it si spossible or not !
I n doing rnd on that !

Thanx

Rohit

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Accepted Solution

by:
kapitany earned 50 total points
ID: 6152135
HI,

you have to create your own hyperlink object. This can be a label for example. What is that you want that this does?
1, if the mouse is ower this label it changes the cursor and the text color.
Change cursor: In this case you have to add a MouseListener to your label and change the cursor:

  public void mouseEntered(MouseEvent e){
    this.setCursor( new Cursor( Cursor.HAND_CURSOR ));
myLabel.setColor(Color.blue);
}

  public void mouseExited(MouseEvent e){
    this.setCursor( new Cursor( Cursor.DEFAULT_CURSOR));
myLabel.setColor(Color.red);
}

Is that what you are looking for?

0
 
LVL 12

Expert Comment

by:ahosang
ID: 6154250
Labels do not generate events.
0
 

Expert Comment

by:kapitany
ID: 6155364
ahosang you are wrong. You can add a mouse listener to a label.
Methods inherited from class java.awt.Component
 action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener,
 addMouseListener, addMouseMotionListener, addPropertyChangeListener,
 addPropertyChangeListener,

etc, so check the API.
BR,
kapi
0
 

Author Comment

by:sidds77
ID: 6173175
thanks kapitany,
that works. There's another slight problem.
This ticker applet has innumerable stock names and prices.
How do i create each individual quote and price as a hyperlink?
These qoutes are retrieved dynamically from the database.
Please help??
0
 

Expert Comment

by:SpideyMod
ID: 8289442
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cipher Configuration on Apache HTTPD 4 63
servlet doXXX methods 3 49
Java SE 8u111  Lot of stuff broke 11 69
Adding multiple JVM environments to RedHat 6 7 23
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.

803 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