Monday, August 24, 2009

Hyperlink in JavaFX


It's a long time being blogging. Actually not done anything new from long time :). Here is one simple concept which some guys asked me. We have provided hyperlink API in JavaFX 1.2 but some of us struggled to open a URL using hyperlink API.


Hmm, 2 ways to do it actually.


No1 : Use the Desktop API of JDK6. It's simple to use. One example is here.


So, very basic code will go like this :


  

package sample2;

import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.*;
import java.net.*;

Stage {
title: "HyperLink to URL"
width: 240
height: 320
scene: Scene {
content: [
Hyperlink{
translateY: 160
translateX: 40
width: 150
text: bind "Visit javafx Samples! "
action: function():Void{
java.awt.Desktop.getDesktop().browse(new URI("http://javafx.com/samples"));
}
}
]
}
}




So, 2 things for running this code. First,Desktop API has been added in JDK6, so this code won't run on JDK5. Second, Add rt.jar(rt.jar of JDK6) file in the Libraries if you are using Netbeans


No2 : For only JavaFX code, we can use AppletStageExtension like this :


package sample1;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Hyperlink;
import javafx.stage.AppletStageExtension;

Stage {
title: "Hyperlink to URL"
width: 250
height: 80
scene: Scene {
content: [
Hyperlink {
text: "JavaFX Samples !"
action: function() {
AppletStageExtension.showDocument("http://javafx.com/samples");
}
}
]
}
}





In this case, you cant send hyperlink from Desktop Application, but it will work fine for applet or Browser application. So, best is to use this and then use our normal funda : if {__PROFILE__}" != "browser") --> use the Desktop API code. What you say :).


Please let me know if there is any issue in the code ! Or also if there is any better way to do this.




31 comments:

Convert Your Scanned Pages to Text said...

Good article

Writers often face problems like entering same matter again and again because it may not necessary be handy. However you can convert your scanned pages (jpeg/tiff/pdf) on http://www.onlinedocumentconversion.com/ and convert online. No need to reenter or repeat text matter again.

I feel even if you have to pay a little bit it’s worth it, because paid sites are definitely better then unpaid sites.

Caution!
Avoid free sites or sites with no after sales support is a NO NO.

WC said...

nice blog~~
please also come to my blog and have a look
http://wcitblog.blogspot.com/

Anonymous said...

[url=http://firgonbares.net/][img]http://firgonbares.net/img-add/euro2.jpg[/img][/url]
[b]quarkxpress 6.52 crash in windows vista save, [url=http://firgonbares.net/]free kaspersky internet security 2009 activation code[/url]
[url=http://firgonbares.net/][/url] free and agricultural and autocad windows xp activation code
to buy educational software [url=http://firgonbares.net/]academic reference software[/url] software selling sites
[url=http://firgonbares.net/]oem software net[/url] mac filemaker pro alternative
[url=http://firgonbares.net/]reseller management software[/url] kaspersky internet security 2009 crack not blacklisted
cheap computer software for [url=http://firgonbares.net/]Adobe Macromedia Anti-Virus[/b]

Anonymous said...

[url=http://sunkomutors.net/][img]http://sunkomutors.net/img-add/euro2.jpg[/img][/url]
[b]adobe photoshop cs4 for mac serial code, [url=http://sunkomutors.net/]buy microsoft word 2003 software[/url]
[url=http://sunkomutors.net/][/url] sell free software discount software discount game software
store system software [url=http://sunkomutors.net/]to sell a software[/url] nero torrent
[url=http://sunkomutors.net/]property management filemaker pro template[/url] student discount software uk
[url=http://sunkomutors.net/]furniture store software[/url] collegiate software best prices
adobe photoshop cs4 academic version [url=http://sunkomutors.net/]sale manager software[/b]

Anonymous said...

[url=http://vonmertoes.net/][img]http://hopresovees.net/img-add/euro2.jpg[/img][/url]
[b]way to buy photoshop, [url=http://vonmertoes.net/]student discount software adobe[/url]
[url=http://bariossetos.net/][/url] software purchase canada adobe photoshop cs3 extended serial
Pro 8 [url=http://bariossetos.net/]Software 20-30[/url] xp professional oem software
[url=http://vonmertoes.net/]microsoft design software[/url] software downloads for free
[url=http://vonmertoes.net/]video store software[/url] student price software
academic poster software [url=http://hopresovees.net/]7 Mac Poser 7[/b]

Anonymous said...

[url=http://murudobaros.net/][img]http://murudobaros.net/img-add/euro2.jpg[/img][/url]
[b]cheapest software anyware, [url=http://murudobaros.net/]wisconsin student discount software[/url]
[url=http://murudobaros.net/]best prices for software[/url] of oem software law office software
free adobe acrobat 9 [url=http://murudobaros.net/]order for software[/url] free adobe photoshop cs4 software
[url=http://murudobaros.net/]adobe software reseller[/url] adobe software educational discount
[url=http://murudobaros.net/]buy microsoft xp software[/url] what is quarkxpress passport
www academic software [url=http://murudobaros.net/]uninstall windows vista[/b]

Anonymous said...

[url=http://vonmertoes.net/][img]http://hopresovees.net/img-add/euro2.jpg[/img][/url]
[b]adobe photoshop cs3 warez download, [url=http://vonmertoes.net/]to be a software reseller[/url]
[url=http://vonmertoes.net/][/url] nero 9 serial keys microsoft software programs
Mac Box Set [url=http://bariossetos.net/]discount software office 2007[/url] discounted computer software for
[url=http://vonmertoes.net/]office applications software[/url] windows vista 64 bit
[url=http://hopresovees.net/]windows vista ultimate activation crack[/url] buy phone software
microsoft office 2007 enterprise sv [url=http://hopresovees.net/]Collection Mac[/b]

Anonymous said...

Good day !.
You re, I guess , probably very interested to know how one can collect a huge starting capital .
There is no need to invest much at first. You may begin to get income with as small sum of money as 20-100 dollars.

AimTrust is what you thought of all the time
AimTrust represents an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

Its head office is in Panama with offices around the world.
Do you want to become really rich in short time?
That`s your chance That`s what you desire!

I`m happy and lucky, I began to get income with the help of this company,
and I invite you to do the same. If it gets down to select a proper companion utilizes your money in a right way - that`s the AimTrust!.
I make 2G daily, and my first investment was 500 dollars only!
It`s easy to get involved , just click this link http://tydarogan.virtue.nu/guzoqus.html
and go! Let`s take this option together to become rich

Anonymous said...

[url=http://bariossetos.net/][img]http://vonmertoes.net/img-add/euro2.jpg[/img][/url]
[b]osx address book into filemaker pro 9, [url=http://vonmertoes.net/]hacked adobe acrobat 9 pro for mac os x[/url]
[url=http://bariossetos.net/][/url] mcafee free download for windows xp kaspersky key finder
oem software sale [url=http://bariossetos.net/]microsoft office 2003 free download[/url] nero free full version
[url=http://hopresovees.net/]student discount software photoshop[/url] buy photoshop cd
[url=http://bariossetos.net/]microsoft office 2000 software[/url] software market discount
discount for microsoft office [url=http://hopresovees.net/]sell own software[/b]

Anonymous said...

Hi, I can’t understand how to add your site in my rss reader. Can you Help me, please :)

Anonymous said...

This is my first post I'd like to thank you for such a terrific made site!
I was sure this would be a nice way to introduce myself!

Sincerely,
Edwyn Sammy
if you're ever bored check out my site!
[url=http://www.partyopedia.com/articles/veggie-tales-party-supplies.html]veggie tales Party Supplies[/url].

Anonymous said...

cragnemierarf, clomid online Smoonebor, buy clomid CootoZica
23

Anonymous said...

[color=red]The Most Affordable XRUMER/BACKLINK SERVICE Online!
The EFFORTLESS and POWERFUL WAY TO BUILD MASSIVE # OF BACKLINKS
[color=black]
200,000 BLASTS of your URLs+ Anchor Tex, message, pictures (can be spinned) etc
$10 USD (shared with other clients like a carpool), or
$25/200k for exclusive!(you control EVERYTHING)
$50 Exclusive @ 500,000 blasts.
(Complete reports will be given to clients)

[IMG]http://img697.imageshack.us/img697/1540/arrowdownh.gif[/IMG]
For orders, questions or concerns? Email: [u]formless.void47 at gmail.com [/u]
Note:
1. For STRICT Whitehat sites, it is advised to create buffers to pass on linkjuice. i.e. social bookmarks, cloaked pages etc.
You can blast the site directly, but it entails risk.
Using buffers are 100% safe, speaking from experience.
2. Xrumer is a very technical tool. Just describe to me what sorts of effects you want and well make it happen!
If you want to buy Xrumer?
>>>>> http://cloakedlink.com/chzgykebsd <<<<<<

[color=black]
-------
CLIENT 2 SAMPLE SPACE FILLED WITH URLs,Pics and Keywords
seo ip google seo proposal seo services manchester buy online pay for performance seo text advertising seo software comparison seo coaching hawaii seo Xrumer Guide trellian seo toolkit seo factors seo security how to seo seo test seo marketing seo web services seo mumbai Buy Blog Links no buy seo cornwall long tail seo website seo xrumer 50 palladium xrumer 5 palladium aaron wall seo book seo algorithm graphic designers new seo big mouth media seo agency manchester jacksonville seo cheap buy seo taunton Xrumer Help net seo seo toolbar seo methodology raleigh seo backlink seo pricing Xrumer License guaranteed seo search engine ranking buy sell link seo cost seo cochin seo bhopal seo company boston

-----
CLIENT 3 SAMPLE SPACE
[url=http://provenheightincrease.co.cc/ebook/how-to-increase-human-height]how to increase human height[/url] http://provenheightincrease.co.cc/ebook/how-to-increase-human-height

[url=http://herpeset.co.cc/cheap/Herpes-Simplex-Lesions-Genital-Herpies-Genetil-Herpes.html]herpes simplex lesions genital herpies genetil herpes[/url]

http://www.gather.com/viewArticle.action?articleId=281474977924553 Buy ultra wizard smokes reviews Buy canofbuds.com reviews Buy internationaloddities.com reviews

[url=http://survivingprison2.jimdo.com/2009/12/16/your-going-to-prison-you-re-going-to-prison-you-are-going-to-prison-to-get-paroled-tip-going-to-jail/]YourGoingToPrisonYouReGoingToPrisonYouAreGoingToPrisonToGetParoledTipGoingToJail[/url]


-----
CLIENT 4 SAMPLE SPACE
[url=http://provenheightincrease.co.cc/ebook/activites-that-helps-human-to-grow]activites that helps human to grow[/url] http://provenheightincrease.co.cc/ebook/activites-that-helps-human-to-grow

[url=http://growyourdick.co.cc/penile/weight-loss-increase-penis-size]weight loss increase penis size[/url] http://growyourdick.co.cc/penile/weight-loss-increase-penis-size

http://teethwhiteningstripsreviews.info/xr/tooth-whitening-st-louis.html

http://buycheapplasmatv.info/cgi-bin/index.pl?=pioneer-pdp4280xd-plasma-tv [url=http://buycheapplasmatv.info/cgi-bin/index.pl?=pioneer-pdp4280xd-plasma-tv]pioneer pdp4280xd plasma tv[/url]

[url=http://teethwhiteningstripsreviews.info/xr/first]youtube teetfh whitening Dryden home remedy which is the best tooth whitener product teeth whitening stripes tootgh whitening teeth whihening fulton teeth whitening design[/url]

-----
CLIENT 5 SAMPLE SPACE
[url=http://cheapxrumerservice.co.cc]Cheap Xrumer Service[/url]
[url=http://cheapxrumerservice.co.cc]Cheapest Xrumer Service[/url]
[url=http://cheapxrumerservice.co.cc]Best Xrumer Service[/url]
--------
https://buypleodinosaur1.wiki.zoho.com/Pleo-A-Ugobe-Life-Form-Pleo-Auction-Pleo-Best-Pleo-Dinosaur-A-Ugobe-Life-Form-Pleo-Dinosaur-Price-.xml?a=1

http://cheaphdtvplasma.co.cc/television/37-tv [url=http://cheaphdtvplasma.co.cc/television/37-tv]37 tv[/url]

Anonymous said...

Hi!
You may probably be very interested to know how one can make real money on investments.
There is no initial capital needed.
You may begin earning with a money that usually is spent
on daily food, that's 20-100 dollars.
I have been participating in one company's work for several years,
and I'll be glad to share my secrets at my blog.

Please visit blog and send me private message to get the info.

P.S. I earn 1000-2000 per daily now.

http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

Anonymous said...

voxco [url=http://www.milesplit.us/members/Tadalafil/]tadalafil 20mg india[/url] yevksaj

Anonymous said...

Hi!
You may probably be very curious to know how one can make real money on investments.
There is no initial capital needed.
You may commense earning with a money that usually goes
on daily food, that's 20-100 dollars.
I have been participating in one project for several years,
and I'm ready to share my secrets at my blog.

Please visit my pages and send me private message to get the info.

P.S. I make 1000-2000 per daily now.

http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

Anonymous said...

Predilection casinos? into this still wetness behind the ears [url=http://www.realcazinoz.com]casino[/url] advisor and tergiversate online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also strengthen our untrained [url=http://freecasinogames2010.webs.com]casino[/url] orientate at http://freecasinogames2010.webs.com and harvest be realized to then fabulously touched in the skull !
another solitary [url=http://www.ttittancasino.com]casino spiele[/url] get one's hands is www.ttittancasino.com , in compensation german gamblers, downward slope upon during eleemosynary online casino bonus.

Anonymous said...

Infatuation casinos? inquire this advanced [url=http://www.realcazinoz.com]casino[/url] advisor and tergiversate online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also hinder our current [url=http://freecasinogames2010.webs.com]casino[/url] control at http://freecasinogames2010.webs.com and subjugate virtual money !
another lone [url=http://www.ttittancasino.com]casino spiele[/url] locate is www.ttittancasino.com , as contrasted with of german gamblers, weakening upon erstwhile magnanimous online casino bonus.

Anonymous said...

chararorylarp, buy zyrtec, Carardykats, [url=http://www.webjam.com/zyrteconline]zyrtec[/url], Glaccerve

Anonymous said...

all because of 21 and be in be elfin of of some matured toys? brook [url=http://www.avi.vg]sex toys [/url] online, friendly pick of grown-up toys like [url=http://www.avi.vg/category.php?a=coition4sexx&cid=3]vibrators [/url] and [url=http://www.avi.vg/category.php?a=lovemaking4sexx&cid=30]dildos [/url]at www.avi.vg , understandable nigh the acquiesce, another susceptibility ball regatta to promote change of attitude [url=http://www.ewgpresents.com]viagra online[/url] is the all firsthand http://www.ewgpresents.com and the unrivalled ed rx [url=http://www.rxpillsmd.net]online viagra[/url] apothecary www.rxpillsmd.net , and the frequency generic [url=http://www.generic4you.com]viagra[/url] drugstore at www.generic4you.com or at www.generik4u.com the [url=http://www.generik4u.com]sildenafil citrate[/url] shop.

Anonymous said...

Verduekssem, propecia online, spancenus, [url=http://virb.com/propeciaonline]propecia[/url]

Anonymous said...

http://libertarianrepublican.blogspot.com/2009/02/australia-arson-suspect-arrested-muslim.html

Anonymous said...

[url=http://www.dezinedepot.com/user/42448#]payday advance cash loan[/url]

[url=http://www.dezinedepot.com/user/42457#]advance payday loan[/url]
[url=http://www.dezinedepot.com/user/42461#]instant payday[/url]
[url=http://www.dezinedepot.com/user/42465#]cash advance loan[/url]
[url=http://www.dezinedepot.com/user/42466#]cash quick loan[/url]

[url=http://www.dezinedepot.com/user/42469#]payday loan faxless[/url]
[url=http://www.dezinedepot.com/user/42473#]payday check loans[/url]

[url=http://www.wikio.com/article/fax-savings-account-payday-loan-150704120#]fax savings account payday loan[/url]

[b][url=http://ameriadvance.com/?affid=9775#]Get your payday loan now![/url][/b]

Anonymous said...

[url=http://www.c-medical.biz/]buy cialis[/url] and [url=http://www.medical-250l.biz/]viagra online[/url] at the finest and most trusted generic drugs online pharmacies : www.c-meical.biz and www.medical-250.biz ,
verification up on our proletariat prices in search viagra, cialis, levitra and more drugs online.

Anonymous said...

[url=http://www.c-medical.biz/]buy cialis[/url] and [url=http://www.medical-250l.biz/]viagra online[/url] at the finest and most trusted generic drugs online pharmacies : www.c-meical.biz and www.medical-250.biz ,
constraint our uncouth prices in behalf of viagra, cialis, levitra and more drugs online.

Anonymous said...

Purchase Cheapest drugs here:
[url=http://www.anobii.com/buyemycin]buy e-mycin[/url]
[url=http://www.anobii.com/buyinderal]buy inderal[/url]
[url=http://www.anobii.com/buysingulair]buy singulair[/url]
[url=http://www.anobii.com/buykeflex]buy keflex[/url]
[url=http://www.anobii.com/buyseroquel]buy seroquel[/url]

Anonymous said...

[url=http://www.dezinedepot.com/user/42448]payday advance cash loan[/url]
[url=http://www.dezinedepot.com/user/42457/]advance payday loan[/url]
[url=http://www.dezinedepot.com/user/42468]payday loans check[/url]
[url=http://www.dezinedepot.com/user/42456]payday advance loan[/url]
[url=http://www.dezinedepot.com/user/42467]rates personal loan[/url]

Anonymous said...

I am reading this article second time today, you have to be more careful with content leakers. If I will fount it again I will send you a link

Anonymous said...

You have to express more your opinion to attract more readers, because just a video or plain text without any personal approach is not that valuable. But it is just form my point of view

Anonymous said...

Hello,

I am regular visitor of this website[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url]Plenty of useful information on java4ever.blogspot.com. I am sure due to busy scedules we really do not get time to care about our health. Let me present you with one fact here. Research displays that closely 70% of all United States grownups are either obese or overweight[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url] So if you're one of these citizens, you're not alone. In fact, most of us need to lose a few pounds once in a while to get sexy and perfect six pack abs. Now the question is how you are planning to have quick weight loss? [url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips]Quick weight loss[/url] is not like piece of cake. If you improve some of your daily diet habbits then, its like piece of cake to quickly lose weight.

About me: I am blogger of [url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips]Quick weight loss tips[/url]. I am also mentor who can help you lose weight quickly. If you do not want to go under painful training program than you may also try [url=http://www.weightrapidloss.com/acai-berry-for-quick-weight-loss]Acai Berry[/url] or [url=http://www.weightrapidloss.com/colon-cleanse-for-weight-loss]Colon Cleansing[/url] for effective weight loss.

Anonymous said...

[url=http://www.drawingboard.org/blogs/?u=videoseaida1]Intertech iPod Converter[/url] [url=http://citizenblogs.com/?u=videoseantonia3]Flash Video Recorder 1.00[/url]
VOB to AVI Converter Asee soft DVD Video to DivX Converter
http://www.drawingboard.org/blogs/?u=videoseabigayle6 KingConvert iPod Touch Converter
[url=http://www.blogportalen.no/blog/?u=videoseariana5]Top Video Joiner[/url] [url=http://blog.bakililar.az/videoseabby8/]IM DVD Image Capture[/url]
Adobe Creative Suite 4 Master Collection IM DVD Image Capture
http://cloudcomputingusersgroup.org/members/Agood-YouTube-to-Zune-Mp4-Converter-62/default.aspx Xilisoft DVD to PSP Converter 4.0.96.1229
Apex Video Converter Super 6.16
my icq:858499940385