Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:18 Go to next message
sam mn is currently offline sam mnFriend
Messages: 26
Registered: August 2010
Junior Member
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 16:14]

Report message to a moderator

Re: masked value for swt text field based on indicator [message #760124 is a reply to message #759834] Thu, 01 December 2011 11:52 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
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.



Lakshmi P Shanmugam
Re: masked value for swt text field based on indicator [message #760340 is a reply to message #760124] Fri, 02 December 2011 01:08 Go to previous messageGo to next message
sam mn is currently offline sam mnFriend
Messages: 26
Registered: August 2010
Junior Member
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 06:11 Go to previous message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
From javadoc of setEchoChar "...setting the echo character to '\0' clears the echo character and redraws the original text"

Lakshmi P Shanmugam
Previous Topic:StyledText with Image?
Next Topic:How to scroll in this composite with Page-Up/Down?
Goto Forum:
  


Current Time: Thu Apr 25 15:08:34 GMT 2024

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

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

Back to the top