Messing something up with input focus
Hi, I am writing on an MHP-Application for the second time. I am trying to implement user input with HSinglelineEntry but it's not working. I think I am doing something wrong with the focus- and HTextEvent.
Here is a code sample:
public class AppReg extends HContainer implements HFocusListener, HKeyListener{
.
.
.
private HSinglelineEntry pwField;
pwField = new HSinglelineEntry(39,159,166,30,50);
pwField.setBackground(new Color(255,255,255));
pwField.setName("password");
pwField.setFont(new Font("Arial",Font.PLAIN,20));
pwField.setForeground(new Color(255,255,255));
pwField.addHFocusListener(this);
pwField.addHKeyListener(this);
add(pwField);
public void setEditable(boolean b){
if(b){
HTextEvent startEvent = new HTextEvent(pwField,HTextEvent.TEXT_START_CHANGE);
pwField.processHTextEvent(startEvent);
}else{
HTextEvent endEvent = new HTextEvent(pwField,HTextEvent.TEXT_END_CHANGE);
pwField.processHTextEvent(endEvent);
}
}
public void focusGained(HFocusEvent setFocusEvent) {
pwField.processHFocusEvent(setFocusEvent);
}
}
How do check which component does have the focus?
How can I change the focus?
Thanks for any help.

