This site requires JavaScript, please enable it in your browser!
Greenfoot back
Lethal_Vitamin
Lethal_Vitamin wrote ...

2014/2/6

Hyperlink?

Lethal_Vitamin Lethal_Vitamin

2014/2/6

#
Is there any way that I can set an actor in my scenario as a hyperlink?
bourne bourne

2014/2/6

#
I found this: http://stackoverflow.com/questions/10967451/open-a-link-in-browser-with-java-button
Lethal_Vitamin Lethal_Vitamin

2014/2/7

#
I imported java.net.* and tried this,
1
2
3
4
5
try
{
    Desktop.getDesktop().browse(new URL("http://www.google.com").toURI());
}          
catch (Exception e) {}
,but it gave me this error: cannot find symbol-variable Desktop
Lethal_Vitamin Lethal_Vitamin

2014/2/7

#
My Scenario The bug is in my Link class.
kiarocks kiarocks

2014/2/7

#
That's because the Desktop class is from java.awt, so you'll need to import that as well.
Lethal_Vitamin Lethal_Vitamin

2014/2/8

#
ty
You need to login to post a reply.