This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 43

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: 43

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!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt whit Netbeans
 
Similar Threads
Is it possible to Drag and Drop among columns in a Same JTable
Building a Dynamic Web Page
Swing and NetBean
how to add custom swing component into IDE generated JFrame from swing pallete.
JCalendar Date Picker question