Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java thread: Lightweight Phone Number Field


Message #1 by melody.siska@5... on Tue, 16 Jan 2001 23:19:18 -0000
Hey Melody,

	One way you can do it, is by subclassing that text field and creating another 
class called phoneNo_textfield. In that class you can break this one text field into 
multiple data structures as follows:
	
	Create a Label  '('
	
	Create a textfield and restrict the input to 3 alpha numeric characters
	
	Create another label ')'
	
	Create a textfield and restrict the input to three alpha numeric characters
	
	Create a label '-'
	
	Create another text field and restrict the input to three alph numeric 	
	characters

Anant

> Date: Tue, 16 Jan 2001 23:19:18 -0000
> Subject: [pro_java] Lightweight Phone Number Field
> To: "Professional Java" <pro_java@p...>
> From: melody.siska@5...
> List-Unsubscribe: <mailto:$subst('Email.Unsub')>
> 
> Hello,
> 
> Does anyone know where i may be able to find code or help with create a
> phone number jtextfield? I want to create a lightweight component that
> will allow the user to type in only numbers and fill the phone field. I
> would like the "(", ")", and "-" to be part of the text field that stays
> there. For example the user would see:
> 
>          Phone Number:  (   )    -       
> 
> Then user types: 
> 
>           5558889999
> 
> He would see the following in his textbox: 
> 
>            (xxx)xxx-xxxx
> 
> I would like to be able to use this with my IDE. It seems like it would be
> such an easy thing to do... I have just never created any beans. Any
> advise would be truly appreciated~!
> 
> Thanks in advance!
> Cheers!
> Melody
> 

  Return to Index