2011-12-05 4 views
0

TextField에 라벨을 지정하고 싶습니다. 다음 코드LWUIT : 레이블을 텍스트 필드에 할당하는 방법

TextField textField = new TextField(); 
Label label = new Label("Pick a unique username"); 
textField.setLabelForComponent(label); 
textField.setConstraint(TextField.ANY); 
form.addComponent(textField); 
form.show(); 

위의 코드가 TextField의 관련 라벨을 표시되지를 사용하고 있습니다. 어떻게 할 수 있습니까?

답변

1

따라서하여 단지 본 Component 지금 실제 함께 시각적으로 결합/인식 같이 단일 그룹과 연관된다 Labellink

public void setLabelForComponent(Label componentLabel) 

Allows us to indicate the label associated with this component thus providing 
visual feedback related for this component e.g. starting the ticker when the 
component receives focus. 

Parameters:  
componentLabel - a label associated with this component 

@ LWUIT의 자바 독에서 Component 발췌.

.

ComponentGroupTextFieldLabel과 함께 사용하는 것이 좋으며 그룹으로 스타일을 지정할 수도 있습니다. ComponentGroup

PS에 대한 자세한 내용은 this 링크를 확인하십시오ComponentGroupLWUIT 1.5에서 사용할 수 있습니다.

+0

도움을 주셔서 감사합니다. 실제로는 –

+0

화장실에서 근무했습니다.이 게시물의 향후 독자를 돕기 위해이 답변을 수락하는 것이 좋습니다. – Vimal

관련 문제