Starten und Beenden der Applikation
Im nachstehenden Code wird gezeigt, wie man die Applikation startet und beendet.
Starten der Applikation
Bevor Sie die Applikation starten müssen die entsprechenden Klassen importiert werden (siehe unten).
01 // Access general JAVA-COM bridge classes
02 import com.altova.automation.libs.*;
03
04 // Access AuthenticDesktop Java-COM bridge
05 import com.altova.automation.AuthenticDesktop.*;
06 import com.altova.automation.AuthenticDesktop.Enums.SPYViewModes;
07
08 /**
09 * A simple example that starts AuthenticDesktop COM server and performs a view operations on it.
10 * Feel free to extend.
11 */
12 public class RunAuthenticDesktop
13 {
14 public static void main(String[] args)
15 {
16 // An instance of the application.
17 Application authenticDesktop = null;
18
19 // Instead of COM error-handling, use Java exception mechanism.
20 try
21 {
22 // Start AuthenticDesktop as COM server.
23 authenticDesktop = new Application();
24 // COM servers start up invisible so we make it visible
25 authenticDesktop.setVisible(true);
26
27 ...
28 }
29 }
30 }
Beenden der Applikation
Die Applikation kann wie unten gezeigt beendet werden.
1 {
2 // Make sure that AuthenticDesktop can shut down properly.
3 if (authenticDesktop != null)
4 authenticDesktop.dispose();
5
6 // Since the COM server was made visible and still is visible, it will keep running
7 // and needs to be closed manually.
8 System.out.println("Now close AuthenticDesktop!");
9 }