• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

textfield masking

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THanks you had solved my big problem.Thanks again.

I want to ask java gurus how can I mask a text box ---> suppose I have to type date as 10:10:23PM (hours/minutes/seconds).Could it be possible that __:__:__ is wrtten over there and as the programmer writes in the text box he jump to next letter automatically.As I have to write 10:10:23 PM so as I write "10" my cursor moves to next letter "1" rather that to colon.

Another Question is
How could I change the color of Jlabel on my form.As suppose while processing form an error occurs and then only those fields in which error occurs appear with text color on label changes

How can I show tooltip text or as the mouse reaches to a particular textfield it could show a small text as how one should fill the box.

payal sharma
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi payal,
yes you can have masking for textfield. for this u'll have to use the PlainDocument class. u can find the details at this link.
http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html#validation

for second problem u can use label.setForeground(color) .

for showing tooltip. use textfield.setToolTipText("fill the field");

regards
deekasha
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i didn't get the plain text field class.
The for the tooltip problem it will work only with the light weight swing components.
 
reply
    Bookmark Topic Watch Topic
  • New Topic