Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating hyperlinks in an applet...

Posted on 2001-06-03
8
Medium Priority
?
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 

Accepted Solution

by:
kapitany earned 150 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

721 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