• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt whit Netbeans

 
Marcelo Bordolli
Ranch Hand
Posts: 46
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use drag and drop to make jtextfield in my GUI, it looks like this:

ID: (HERE IS THE JTEXTFIELD)

now i want that the user only put numbers in that jtextfield and i got this code:




but i dot know were to put it because i use drag and drop and the ide dont let me edit. what can i do??
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Select JTextField you want to apply your code to. Then navigate to Properties window (if it's not visible in your layout, go right click on component -> Properties). Choose Events tab and find keyTyped in that list. Pick the value from combo box on the right and click on it, NetBeans will generate method stub for you to put your code into.
 
Marcelo Bordolli
Ranch Hand
Posts: 46
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah that did the job thanks man!!!
i got this book"NetBeans-Definitive-Guide-Tim-Boudreau" im going to read it to find out more!
Now im only one issue to finish for ever this Gui project is in the other topic that i start today, if you could answer that i can finnally close this chapter of my life :O
Thanks Kemal!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic