Solved

HyperLink in JApplet

Posted on 2003-10-30
7
321 Views
Last Modified: 2012-08-13
hi ,
I want to set hyperlinks on text or lables in JApplet.Plzzzzzzzz tell me how to do that...actually i don't want to show any html page on that link...i just want to show some text in one text area when clicked on diff links...so what shud i do??i shud use JButton or JLabel or any other component for hyperlink??

plzzzzzzzzzz help
Thanx in advance.

0
Comment
Question by:sushpb4u
[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
  • 5
  • 2
7 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 9648963
I use a JLabel with Cursor set to Cursor.HAND_CURSOR, and the font blue

then just add a mouseDown event (actionListener), and you're away :-)

Underlining the text is another thing altogether :-/
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9648973
Or here:

http://www.jgui.com/

has a JHyperlink class
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9648988
but it basically does exactly what I said :-)

You can get the source from here:
http://www.jgui.com/downloads/jgui_source_17_oct_03.zip

and to underline the text, it does

public void setText( String s )
{
  super.setText( "<html><u>" + s + "</u></html>" ) ;
}

(ie: sets the text to being a bit of HTML for underline)
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:sushpb4u
ID: 9649101
thanx...i did that..but plz tell me how can I set underline ???
0
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 9649117
String s = "View This" ;
label.setText( "<html><u>" + s + "</u></html>" ) ;
0
 

Author Comment

by:sushpb4u
ID: 9649122
yes got that..thanx:)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9649304
:-)
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 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.
Suggested Courses

635 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