Verifying component hierarchy in Java UI

We have a very large Java Swing desktop application consisting of a large number of views. Over the years, the developers have done a very good job of selecting suitable placements that reflect the overall structure of our user interface for these views. Most of this time, it is very useful for tracking certain components that have errors that need to be looked after. However, there are cases when searching for a panel, dialog, etc. Pretty painful. Usually it involves searching our property files for unique string sequences that appear in the user interface.

Does anyone know of a third-party tool that allows a developer to connect to a Swing application and click on a user interface area to show this name / package / hierarchy of the component that was clicked?

+3
source share
4 answers

SwingExplorer is the perfect tool for this. It does what you describe, and even more (step-by-step drawing of Java2D, EDT, AWT events violations).

Note: the project moves to java.net .

+4
source

Does anyone know of a third-party tool that allows a developer to connect to a Swing application and click on a user interface area to show that the name / package / hierarchy of the component that was clicked on

Darryl . , . MouseListener , , , .

+3

There, something does exactly what you are looking for in SwingX Demo. The JXTreeTable demo contains a tree of component hierarchy, when the mouse moves over a specific component, it is selected in the table.

You can look here

+1
source

I could not believe it myself, but it can be very simple:

SwingUtilities.getRoot(...).list()

The list method exists since 1.0. lol.

0
source

Source: https://habr.com/ru/post/1784027/


All Articles