The Artima Developer Community
Sponsored Link

Java Answers Forum
Hyperlink in JTable

1 reply on 1 page. Most recent reply: Feb 9, 2005 11:04 PM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
vetriselvan

Posts: 1
Nickname: vetrri
Registered: Feb, 2005

Hyperlink in JTable Posted: Feb 9, 2005 9:42 PM
Reply to this message Reply
Advertisement
Is it possible to put a data in JTable as a hyperlink and when click the data in JTable we have to go to that page specified in th url....
regards,
O.vetriselvan


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Hyperlink in JTable Posted: Feb 9, 2005 11:04 PM
Reply to this message Reply
Yes, it is possible.
The JTable of Java can do many things you nevver dreamed of.

A JTable uses Cell Renderers and Cell Editors (see API documentation).

Normally, allmost all Object types are displayed with a standard Text field.

You have to create a new Table Model wich calls a special Cell Renderer and Cell Editor for URLs.

Do distinguish URLs from normal text, you should create a new class or use for example the URL class.

In the method, wich delivers the renderer or editor for a certain cell, check, if the Object type of that cell is URL, then deliver you specialized renderer. In all other cases, deliver the standard renderer.

Flat View: This topic has 1 reply on 1 page
Topic: java mechanics Previous Topic   Next Topic Topic: KODO count(*)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use