This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Mouse Click Opens Web Browser? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Mouse Click Opens Web Browser?" Watch "Mouse Click Opens Web Browser?" New topic

Mouse Click Opens Web Browser?

Cameron Bruce

Joined: Jun 12, 2003
Posts: 4
I have website URL's in a JTable. Is it possible to display them underlined and have the web browser open when the user clicks on a URL in the JTable?
Also I have an email address in the same JTable. Is it possible for the default email client to open (after user click) with a new message to that email address in the JTable?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

You can do this but it's basically just a "hack"... the mechanisms are really platform specific to figure out the "default" web or email clients. Read this JavaWorld article on how to get a good Runtime.exec() engine that knows how to handle at least different versions of Windows. I can get my default browser to pop up using :

And email by using :

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Mouse Click Opens Web Browser?
It's not a secret anymore!