Java Swing Property Editor

Is there an existing library that automatically creates a Java Swing form from a Properties object (or properties)? that is, it displays 2 columns, as many rows as there are properties, correctly justified. Property names on the left, JTextFields for values ​​on the right.

I do not have access to property names (or expected types) at compile time.

In addition, the solution should allow some value fields to be set read-only after construction.

Perfect solution:

  • allow you to specify some property values ​​as sensitive, requiring a JPasswordField
  • provide input format validation, for example. against object type (e.g. URL, Double, etc.)

or type-sensitive, so that the corresponding widget types (or buttons for creating the corresponding widgets) are used instead of the JTextField for standard object types. e.g. JFileChooser for properties that are expected to have a file type, SwingX Select color / date, check number format)

Entering type-specific properties begins to sound like JavaBeans. I would prefer not to go down the JavaBeans route unless there is a really simple rather than a large framework solution for this object, which is Javabean.

(I already know how to do this manually and I can write a simple implementation that ignores sensitivity / type information - anyone who answers these lines will be knocked down! I just want to know if such a beast already exists, a well-preserved library)

UPDATE: Java Beans related - create inspector window

+4
source share
2 answers

There is no such thing. However, I wrote a rudimentary function (and released it OSS) for https://github.com/fommil/zibaldone

0
source

We use JIDE , which is not open source. If you don't mind, take a Property Grid to rotate - it seems to fit all your requirements.

enter image description here

-1
source

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


All Articles