This library allows to generate automatically the GUI (general user interface) of any Java object.

The generation of the GUI requires no other information that the object itself. Its structure is discovered at runtime through Java reflection.The generated GUI can be customized in a non-intrusive way by overriding some key methods of the generator objects.

Use Cases

  • Developing a project GUI by generating and customizing it
  • Prototyping a GUI
  • Exploring a library capabilities quickly through a generated GUI

Project GUIs done using ReflectionUI

Testing Toolkit Custom UI


Basic Object Dialogs

URL Dialog Exception Dialog Class Loader Explorer


  • On the fly Swing GUI generation
  • Generates controls for public fields
  • Generates controls for getter and setter fields
  • Generates controls for methods
  • Generates dialogs for Exceptions
  • Automatic undo/redo management
  • Automatic copy/cut/paste management
  • Dynamic menus support
  • Field validation management
  • On-line help management
  • Non-intrusive customizations
  • Extensibility support
  • Generator pluggable to any data model

Getting started

How to include in a project

With Maven

With The all-in-one archive

  • Get the archive file “reflection-ui-x.x.x-dist.zip” from the download area
  • Extract it
  • Add the following jar to your classpath:
    • reflection-ui-x.x.x.jar
    • dependency/*.jar

How to test

In order to test the library:

  • Run the main class “xy.reflect.ui.ReflectionUI”
  • Enter any class name in the input dialog. Example: “java.util.Date”
  • Enjoy!

How to use

Read this example, see how simple it is,  and start coding:


ReflectionUI is open source.

Use it with maven as described here


Download it from the Github repository.



This UI is generated in 2 steps:

  1. Each object class informations are read and interpreted by the ReflectionUI object as an abstract GUI model: ITypeInfo.
  2. Then this abstract GUI model is passed to the SwingRenderer that will create the various swing controls displaying the object values
(ReflectionUI) (SwingRenderer)
Class ——————–> ITypeInfo ——————–> UI

The ReflectionUI interpretation process is based on the Java language coding standards (ex: getter/setter interpreted as a unique property, …).

Unfortunately, even when these standards are respected, there might not be enough information in every class definition to provide a UI that looks and behaves exactly as expected. This is why the ReflectionUI interpretation process will often need to be customized. This is where the InfoProxyFactory comes into play. It is not essential to the ReflectionUI customization, but it makes it easier by allowing to specify conveniently a ITypeInfo proxy.

(ReflectionUI) (InfoProxyFactory) (SwingRenderer)
Class ——————–> ITypeInfo ——————–> ITypeInfo (proxy) ——————–> UI
             |_______  ____|


If one needs to use this library beyond these basics, then more documentation will be required. It is being written. Let us know if you are interested or even if you want to get involved. Thanks.

More Examples

Explore the the examples in the source code for more information.


The support page is hosted here on GitHub.