0

I would like to ask how to capitalize first letter entered on textfields? example when entering his last name, the first letter will be capitalized.

samles texfields delos reyes | << sample text field and the result should be like this >> |Delos Reyes |

I'm using textfields from netbeans.

Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
ren hangad
  • 17
  • 1
  • 7

1 Answers1

0

I do not know how a NetBeans textfield is different from any other, I assume it's just a JTextField.

Extend a JTextField with your own class and override the insertString method from the Document, like in the API docs.

Or, you could add a listener to your textfield (actually, the underlying document) an update the String accordingly.

Community
  • 1
  • 1
stealthjong
  • 10,858
  • 13
  • 45
  • 84