?
Solved

Clickable text in JTextPane

Posted on 2003-03-25
7
Medium Priority
?
1,005 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
[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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month13 days, 5 hours left to enroll

777 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