Frank Winkler
Frank Winkler

Reputation: 419

install4j: List of Checkboxes

Is it possible to use a list of checkboxes in install4j? Something like this example:

enter image description here

We would prefer to use such a list of checkboxes instead of a simple multi selection list.

thx! Frank

Upvotes: 3

Views: 380

Answers (2)

Ingo Kegel
Ingo Kegel

Reputation: 48005

Serban's solution is good for a small fixed number of options. If the number of options is large or dynamic, there is no such component in install4j.

You could write your own screen with using the check box list from jide common layer. A sample on how to get started, is available in the customCode sample project (see src/SampleScreen.java).

Upvotes: 2

Serban Constantin
Serban Constantin

Reputation: 3576

You could use a configurable form and then adding Check box components for each of your options.

You could then iterate over them using something similar to:

for (Object o : formEnvironment.getFormComponents()){ FormComponent checkbox = (FormComponent)o; if(((JCheckBox)checkbox.getConfigurationObject()).isSelected()){ do something here } }

Upvotes: 3

Related Questions