This might be a simple one, but does anyone know how to add a hyperlink within the simulation panel so that it is
clickable when using a model exported as an applet?
Many thanks
PJ
Dibpin Khadtha — 15.10.07
Hi! I would try to use onClick code of a text box to execute an action. Not sure if it is possible to open a new window
or pop up...
Andrey Malykhanov — 29.10.07
Hello!
As Dibpin Khadtha said, you can use [onClick] property field of any presentation shape, or you can use [Button]. You can
open a web page using the following code:
try {
java.awt.Desktop.getDesktop().browse(new java.net.URI("www.xjtek.com"));
} catch ( Exception e ){
System.out.println ( "Cannot open [www.xjtek.com]" );
}
Andrei — 05.11.07
Actually, if you want a hyperlink WINTIN the model (link to another place of the same active object or to another active
object), you simply define a shape (e.g. a rectangle) and define its onClick code in the following way:
1. To go to a different place of the same diagram: getPresentation().getPanel().setOffsets( -x, -y ); where x, y are the
coordinates of the point you wish to be at the top left corner of the window
2. To show a different active object: getPresentation().setPresentable( anotherAO );
You can set No fill color, No line color for this rectangle if you want it to be invisible.