+ /*
+ * Time for the second application. This one will have a single
+ * window mirroring the contents of the first application. Let's
+ * make it a little larger than the first application's
+ * width/height.
+ */
+ int width = multiScreen.getWidth();
+ int height = multiScreen.getHeight();
+
+ /*
+ * Make a new Swing window for the second application.
+ */
+ SwingBackend monitorBackend = new SwingBackend(width + 5,
+ height + 5, 20);
+
+ /*
+ * Setup the second application, give it the basic file and
+ * window menus.
+ */
+ TApplication monitor = new TApplication(monitorBackend);
+ monitor.addToolMenu();
+ monitor.addFileMenu();
+ monitor.addWindowMenu();
+
+ /*
+ * Now add the third screen to the first application. We want to
+ * change the object it locks on in its draw() method to the
+ * MultiScreen, that will dramatically reduce (not totally
+ * eliminate) screen tearing/artifacts.
+ */
+ TWindowBackend windowBackend = new TWindowBackend(demoApp,
+ monitor, i18n.getString("monitorWindow"),
+ width + 2, height + 2);
+ windowBackend.setDrawLock(multiScreen);
+ windowBackend.setOtherApplication(demoApp);
+ multiBackend.addBackend(windowBackend);
+
+ /*
+ * Three screens, two applications: spin them up!
+ */