skip to main content

Mixing Java dialogs and COBOL windows in the same application

Mixing Java dialogs and COBOL windows in the same application
In the previous chapters we described two possible scenarios:
In both scenarios it can happen that both the COBOL program and the Java program display a dialog in order to interact with the user.
The coexistence of Java dialogs and COBOL windows is possible as long as these simple rules are respected:
When calling Java from COBOL:
Before opening a modal JDialog, the isCOBOL key buffering should be disabled. It can be done by the static method com.iscobol.gui.client.KeyboardBuffer.setBufferOff(). After the JDialog is closed, enable again the key buffering with the static method com.iscobol.gui.client.KeyboardBuffer.setBufferOn(). These methods could be invoked either by the Java program or by the COBOL program.
Before opening any JDialog, the COBOL program should retrieve the current active window (a java.awt.Window instance) to pass it as 'owner' of the JDialog. In this way, with the Alt+Tab key combination you will see only a window as the Java dialog is child of the COBOL window. If this optional step is omitted, then the Alt+Tab key combination will show the Java dialog and the COBOL window as two separate windows.
When calling COBOL from Java:
Sample programs for this task are installed with isCOBOL in the subfolder sample/is-java/mixed-gui.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left