为什么为 TextField 设置 setLabelForComponent 时不显示 Label?
Form 中有 Label
、TextField
和 Container
。我设置:
...
private Container c = new Container(new BoxLayout(BoxLayout.Y_AXIS));
...
impay30 = new Label("Impayé 30j");
impay30.setUIID("FicheLibelle");
impay30.setPreferredW(LabellargeW);
impay30txt = new TextField();
impay30txt.setMaxSize(50);
impay30txt.addDataChangeListener(this);
VirtualKeyboard.bindVirtualKeyboard(impay30txt, vkNombre);
impay30txt.setLabelForComponent(impay30);
c.addComponent(impay30txt);
但在运行时仅显示 TextField 但不显示 Label !那么如何让Label
出现呢?
There are Label
, TextField
and a Container
in a Form. I set :
...
private Container c = new Container(new BoxLayout(BoxLayout.Y_AXIS));
...
impay30 = new Label("Impayé 30j");
impay30.setUIID("FicheLibelle");
impay30.setPreferredW(LabellargeW);
impay30txt = new TextField();
impay30txt.setMaxSize(50);
impay30txt.addDataChangeListener(this);
VirtualKeyboard.bindVirtualKeyboard(impay30txt, vkNombre);
impay30txt.setLabelForComponent(impay30);
c.addComponent(impay30txt);
But in runtime the TextField are only displayed but the Label are not displayed ! So how to make the Label
appear ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将
impay30
添加到Container(c)
中。然后只有它显示在屏幕上。impay30
标签在使用setLabelForComponent
时与impay30txt
组件关联,用于启动Label
的代码当Component
获得焦点时。You have to add
impay30
intoContainer(c)
. Then only its showing on the screen.impay30
label is associate withimpay30txt
component when usesetLabelForComponent
and it will be used for start the ticker of theLabel
when theComponent
receives the focus.