[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Text field that allows only currency entry

See:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet179.java?rev=HEAD&content-type=text/vnd.viewcvs-markup

This snippet formats a date but the concept could be used to format 
currency.

"Charlie Surface" <csurface@xxxxxxxxxx> wrote in message 
news:d58ki3$vkj$1@xxxxxxxxxxxxxxxxxxx
> The Text widget can have a VerifyListener, which will allow you to modify 
> and cancel key events.  Of course, you will need to implement your own 
> pattern matching.  There may also be a JFace class which does this, 
> although I don't know which one.
>
> Charlie
>
>
> shorten5273 wrote:
>
>> I'm a new SWT / Eclipse user and I'm looking for a simple way of creating 
>> a text entry field into which a user may enter only a dollar amount 
>> ($46.78 for instance). I am not concerned at this point in 
>> internationalization as this is an in-house project and will not need to 
>> be used in non-dollar countries. My ideal widget would only allow a user 
>> to enter numeric digits and $,.
>> but having the widget perform some type of validation after an entire 
>> entry has been made would also work.
>>
>> Any hints /help would be appreciated.
>>
>> rs