Hyperlink in Swings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaya3
    New Member
    • Aug 2007
    • 184

    #1

    Hyperlink in Swings

    Hi,
    I have craeted JTable in Swings.I would like to make the contents in that JTable as "hyper link". I have generated JTable as follows.

    String fields[] = {"col1", "col2"};
    String data[][] ={
    {"row1col1","ro w1col2"},
    {"row2col1","ro w2col2"},
    {"row3col1","ro w3col2"}
    }

    JTable tab = new JTable(data,fie lds);

    I want all the values in the JTable as "Hyperlink" text..
    How is this possible?



    -Thanks & Regards,
    Hamsa
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by gaya3
    Hi,
    I have craeted JTable in Swings.I would like to make the contents in that JTable as "hyper link". I have generated JTable as follows.

    String fields[] = {"col1", "col2"};
    String data[][] ={
    {"row1col1","ro w1col2"},
    {"row2col1","ro w2col2"},
    {"row3col1","ro w3col2"}
    }

    JTable tab = new JTable(data,fie lds);

    I want all the values in the JTable as "Hyperlink" text..
    How is this possible?



    -Thanks & Regards,
    Hamsa
    The best approach is probably to create your own cell renderer with mouse listener capabilities because the default renderer is based on a JLabel which doesn't have these capabilities.

    Comment

    Working...