Project

General

Profile

Debugging GUI

This page contains useful tips that may help with debugging GUI related issues.

Widget Browser

Often it is needed to examine the state of the individual widgets when solving GUI issues. For complex screens this may be a daunting task. FWD contains a graphical tool capable of inspecting all the widgets at runtime. Widget browser, when enabled, opens additional window for every 4GL window or 4GL dialog displayed on the screen.

To enable this feature, create the file build.properties in the root directory of FWD project and add widget.browser=true to it. This will include Widget browser Java sources in the build and so you will need to rebuild the project. Last but not least add widget.browser Java property to the command starting FWD client. Add -Dwidget.browser command line argument to the java command responsible for starting FWD client. The command will become java -Dwidget.browser com.goldencode.p2j.ClientDriver <additional parameters>.

When Widget Browser is enabled new menu item "Widget Browser" is added to the system popup menu of every window. Choosing this item will start Widget Browser for this particular window.

Web GUI

Making Widget Browser work in Web GUI requires small changes in FWD code base. FWD very forcefully enforces the Java headless mode, which prevents Swing UI from running. This solution also requires running FWD on system with active desktop.

Add the following line just after the if block statement if (jvm.indexOf("-Djava.awt.headless=true") == -1) {...} in ClientBuilderOptions.

jvm = jvm.replace("-Djava.awt.headless=true", "-Djava.awt.headless=false -Dwidget.browser");