Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Rpelacing characters (*) with user input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Rpelacing characters (*) with user input" Watch "Rpelacing characters (*) with user input" New topic
Author

Rpelacing characters (*) with user input

Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Hi all -
There has to be a simple solution to this, but as far as I've searched, I've found nothing.
I have a Custom TextField that is descended from java.awt.TextField (believe me, I'd much rather use swing).
The user must enter 14 characters into this field.
The problem is, most of those characters are zeros and they have to count for every keyboard
stroke they hit.
I want to put in fourteen * so every time they enter a character, the * is replaced by
their input. That way, they see how many characters they have left because the * will be one less
for every letter or number they put in.
Like this:
**************
B*************
BN************
BNO************
BNO4**********

And so on.

Does anyone know a good way to do this?
I am an experienced developer, but have never had this challenge before.

Any help would be greatly appreciated.

Brady
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Does anyone know a good way to do this?

good - no, dodgy - yes.

Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Paul -
Thanks for responding.
You were right... it was a bit dodgy
Thanks for the try, though, but I need to change the characters
one at a time as they are typed.
I know there's a way to do this, but I may be limited as I am working
in 1.4
Anyway, thanks for the reply.

Brady
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4571
    
    5

Brady Diggs wrote:Paul -

Paul?


luck, db
There are no new questions, but there may be new answers.
Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
So sorry, Michael. Don't know where I got Paul...
Thanks for the correction Darryl.

But thanks for the reply Michael.
But I still haven't found and elegant solution to this.
If anyone has any suggestions, I would be your slave
your life.
Thanks!
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4571
    
    5

Rob Camick's Text Prompt may be useful.
Brady Diggs
Ranch Hand

Joined: Jun 26, 2008
Posts: 42
Thanks Darryl!
That's not exactly what I need, but I can certainly use
some of his design.
I appreciate you pointing me to it.
Rob does it again!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rpelacing characters (*) with user input