Skip to content

a tool to inspect Java Swing GUIs like it is done in browsers with HTML pages

License

Notifications You must be signed in to change notification settings

elbosso/swinginspector

Repository files navigation

Swing-Inspector

Pipeline status GitHub release GitHub tag GitHub license GitHub issues GitHub issues-closed contributions welcome GitHub contributors Github All Releases Website elbosso.github.io

Demo-Video

Preconditions

Java 17

Build

mvn -U package assembly:single

Usage

Starting a client application

Any Java application using Swing for its GUI can be used with the tools provided here - just start it with the jar file built in target as premain-jar like this:

java -javaagent:<path-to>/swinginspector-x.y.z-SNAPSHOT-jar-with-dependencies.jar -jar <clientapp>.jar

After starting the application in question, one more frame opens - a rather small one, so watch out - it is even possible that this frame opens behind others. Its title is Manager and it initially contains only one button named register. Push that button and the inspection begins: on mouse over, the deepest component is highlighted with a dashed red border. Whenever the user clicks in this mode, the inspection mode ends - at that point it is important to increase the size of the Manager frame. It now not only holds the register button but also a generated GUI for adjusting properties of the component the user clicked on while in inspection mode. Changes made here are instantly applied to the component in question.