Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

Can i make links to web pages with java swing?

Pretty much what the title says...

I want to be able to put a web link on a simple java swing program.
0
rt_vin
Asked:
rt_vin
1 Solution
 
OliWarnerCommented:
errr... you'd have to have a load browser command... of which I cant find an explicit one...
0
 
gdrnecCommented:
Of course you can.

The question is what does the link do? If, for instance, you are accessing servlet urls that don't return any exotic content, then it is as simple as opening the URL. I do this when I am converting to a Swing app from a servlet app so as to not lose functionality during the rewrite.

The problem arises when you need to deal with complicated content like flash etc... If you do need to deal with that kind of content, you could always command line invoke the default browser giving the url as the argument.


(e.g. java.lang.Runtime.getRuntime().exec("iexplore http://www.somelink.url/");

Hope this helps.

Geoff
0
 
rt_vinAuthor Commented:
Thanks Geoff, that's what i wanted :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now