Creating object by name in Java

Discussion created by modybsystematics-co-il-esridist Employee on Jan 2, 2013
Latest reply on Jan 3, 2013 by modybsystematics-co-il-esridist
I am developing an Engine Java application.
I would like to use the ready-to-use buttons but I do not like the toolbar control.
I used the techniques described here: under the "Control commands without the ToolbarBean" subject but I changed the code a little to look like this:
ICommand c = (ICommand)new ControlsSelectFeaturesTool();
This works nicely.
Now I would like to create my buttons dynamically by some configuration file.
I would like the software to read the file and create the buttons by the names found in the file.
For example if the string in the file is "Controls.ControlsSelectFeaturesTool" I would like to run something like this:
ICommand c = (ICommand)CreateObject("Controls.ControlsSelectFeaturesTool")

Can somebody explain if this can be done and how?