Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » masked value for swt text field based on indicator
masked value for swt text field based on indicator [message #759834] Wed, 30 November 2011 04:18 Go to next message
Eclipse UserFriend
trying to make characters typed into a text into masked ones based on a checkbox indicator.

tried the below code, but it is not working:

valueText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
if(maskIndicator.getSelection()){
valueText.setEchoChar('*');
}
}
});

why is echoChar not working??
can someone guide me, what i am doing wrong here.

[Updated on: Wed, 30 November 2011 11:14] by Moderator

Re: masked value for swt text field based on indicator [message #760124 is a reply to message #759834] Thu, 01 December 2011 06:52 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

setEchoChar() doesn't work for Text with SWT.MULTI style. Are you using SWT.MULTI or SWT.SINGLE style?

Also, since you are using the echo character based on the checkbox indicator, it is better to set and unset the echo character using setEchoChar() in the checkbox's selection listener.

Re: masked value for swt text field based on indicator [message #760340 is a reply to message #760124] Thu, 01 December 2011 20:08 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the SWT.Single info Lakshimi.

how do we unset echochar?
Re: masked value for swt text field based on indicator [message #760355 is a reply to message #760340] Fri, 02 December 2011 01:11 Go to previous message
Eclipse UserFriend
From javadoc of setEchoChar "...setting the echo character to '\0' clears the echo character and redraws the original text"
Previous Topic:StyledText with Image?
Next Topic:How to scroll in this composite with Page-Up/Down?
Goto Forum:
  


Current Time: Wed Jul 23 09:20:14 EDT 2025

Powered by FUDForum. Page generated in 0.25528 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top