JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
final TextField bean = new TextField();
final StringScalarBox scalarBox = new StringScalarBox();
panel.add(bean, BorderLayout.CENTER);
final JLabel focusLabel = new JLabel("grab Focus");
focusLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
focusLabel.grabFocus();
}
});
panel.add(focusLabel, BorderLayout.SOUTH);
TangoKey attributeKey = new TangoKey();
TangoKeyTool.registerAttribute(attributeKey, "tango/tangotest/titan", "double_scalar");
scalarBox.connectWidget(bean, attributeKey);
scalarBox.disconnectWidgetFromAll(bean);
TangoKeyTool.registerAttribute(attributeKey, "katy/gs/publisher", "Double_Value");
scalarBox.connectWidget(bean, attributeKey);
scalarBox.disconnectWidgetFromAll(bean);
JFrame frame = new JFrame();
frame.setContentPane(panel);
frame.pack();
frame.setTitle("Test");