JPanel stringPanel = new JPanel(new BorderLayout());
JPanel numberPanel = new JPanel(new BorderLayout());
StringScalarBox stringBox = new StringScalarBox();
NumberScalarBox numberBox = new NumberScalarBox();
TangoKey stringKey = new TangoKey();
TangoKeyTool.registerAttribute(stringKey, "tango/tangotest/titan", "string_scalar");
TangoKey stringImageKey = new TangoKey();
TangoKeyTool.registerAttribute(stringImageKey, "tango/tangotest/titan", "string_spectrum_ro");
TangoKey numberKey = new TangoKey();
TangoKeyTool.registerAttribute(numberKey, "tango/tangotest/titan", "ampli");
// text component
TextField textfield = new TextField();
TextArea textArea = new TextArea();
FileBrowser fileBrowser = new FileBrowser();
stringBox.connectWidget(textfield, stringKey);
stringBox.connectWidget(textArea, stringImageKey);
stringBox.connectWidget(fileBrowser, stringKey);
fileBrowser.setUpdateAllowed(true);
// added to stringPanel component
stringPanel.add(textfield, BorderLayout.WEST);
stringPanel.add(textArea, BorderLayout.CENTER);
stringPanel.add(fileBrowser, BorderLayout.NORTH);
// number component
Spinner spinner = new Spinner();
Slider slider = new Slider();
WheelSwitch wheelswitch = new WheelSwitch();
// numberBox.connectWidget(spinner, stringKey);
numberBox.connectWidget(spinner, numberKey);
numberBox.connectWidget(slider, numberKey);
numberBox.connectWidget(wheelswitch, numberKey);
// added to numberPanel component
numberPanel.add(spinner, BorderLayout.CENTER);
numberPanel.add(wheelswitch, BorderLayout.EAST);
numberPanel.add(slider, BorderLayout.NORTH);