Simulate web links in Swing using labels? Best/most dynamic way?
What's the best way to simulate something like a clickable web link in Swing? I want to list (for example) people's names vertically on a page so that when you move the mouse over each name the font changes to underline. Also when you click a name a new window opens (that part I can do).
Using Netbeans I created say ten labels, called NameOne .. NameTen. In the code when I've read the names from the database I manually set each label's text to the appropriate name.
I added code to change the colour of the label (for now) when the mouse enters and exits the widget.
This all seems rather hard coded (in terms of variable names) and convoluted. Any suggestions for better ways to do this?
Thanks

