Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Clickable text in JTextPane

Posted on 2003-03-25
7
Medium Priority
?
1,039 Views
Last Modified: 2012-06-21
Hi,

I'm displaying a list of results in a JTextpane and attached to each on eof this results is a number which is used to edit that particular result. In order to edit the results at the moment, I need to enter the number in a textfield and then click a button in order to load its details.

I would like to know if I can possibly make these numbers "clickable" so that, if one clicks on it, the results which can be edited appear. Basically, I want to attach a clickable properties plus some sort of action listener device to the text in a JTextpane,

Is this possible?

much appreciated,

java_gurl.
0
Comment
Question by:java_gurl
  • 4
  • 3
7 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 8202969
Use a JEditorPane. setContentType("text/html"). Then you can use hyperlinks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8202979
You implement your own hyperlink listener so you can take any action you want in the event handler.
0
 

Author Comment

by:java_gurl
ID: 8203047
thanks CEHJ, i'll try that out in the next couple of hours and if it works i'll allocate you the points.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:java_gurl
ID: 8203234
oh just another tiny question. will i be able to use a style sheet for my text?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8204953
Probably not - html support is pretty limited.
0
 

Author Comment

by:java_gurl
ID: 8209334
you get the points!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8209431
:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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 will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

577 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