@@ -148,11 +148,14 @@ Source code for the example is located in /src/main/java/com/openfin/desktop/dem
148148
1491491 . create a canvas and place it where the HTML5 application should be embedded.
150150
151+ ``` java
151152 embedCanvas = new java.awt. Canvas ();
152153 panel. add(embedCanvas, BorderLayout . CENTER );
154+ ```
153155
1541562 . listen to the canvas resize event, and resize embedded HTML5 application accordingly.
155157
158+ ``` java
156159 embedCanvas. addComponentListener(new ComponentAdapter () {
157160 @Override
158161 public void componentResized (ComponentEvent event ) {
@@ -167,29 +170,35 @@ Source code for the example is located in /src/main/java/com/openfin/desktop/dem
167170 }
168171 }
169172 });
173+ ```
170174
1711753 . launch and connect to OpenFin runtime
172176
177+ ``` java
173178 this . desktopConnection = new DesktopConnection (appUuid);
174179 DesktopStateListener listener = new DesktopStateListener () {... };
175180 RuntimeConfiguration configuration = new RuntimeConfiguration ();
176181 configuration. setRuntimeVersion(desktopVersion);
177182 desktopConnection. connect(configuration, listener, 60 );
183+ ```
178184
1791854 . create HTML5 application
180186
187+ ``` java
181188 ApplicationOptions options = new ApplicationOptions (startupUuid, startupUuid, openfin_app_url);
182189 WindowOptions mainWindowOptions = new WindowOptions ();
183190 options. setMainWindowOptions(mainWindowOptions);
184191 DemoUtils . runApplication(options, this . desktopConnection, new AckListener () {... });
192+ ```
185193
1861945 . embed HTML5 application into the canvas
187195
196+ ``` java
188197 startupHtml5app = Application . wrap(this . startupUuid, this . desktopConnection);
189198 Window html5Wnd = startupHtml5app. getWindow();
190199 long parentHWndId = Native . getComponentID(this . embedCanvas);
191200 html5Wnd. embedInto(parentHWndId, this . embedCanvas. getWidth(), this . embedCanvas. getHeight(), new AckListener () {... });
192-
201+ ```
193202
194203## More Info
195204
0 commit comments