aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes doubt whit Netbeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "doubt whit Netbeans" Watch "doubt whit Netbeans" New topic
Author

doubt whit Netbeans

Marcelo Bordolli
Ranch Hand

Joined: Sep 03, 2012
Posts: 46

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??


I know is only java
BUT I LIKE IT!!!
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

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.


The quieter you are, the more you are able to hear.
Marcelo Bordolli
Ranch Hand

Joined: Sep 03, 2012
Posts: 46

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!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doubt whit Netbeans