Community

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
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...
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]" ); }
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.