File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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 agree. Here's the link:
subject: Mouse Click Opens Web Browser?
It's not a secret anymore!