• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

DocumentListener and Netbeans

Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have created two jTextFields in a MainGUI class in netbeans. I have a button which starts disabled. It should only become enabled when the textfields have been updated, say length > 1.

I know I need to implement DocumentListeners to do this, but I'm not sure how I can go about doing this. I have looked at the tutorial on sun's website and the code provided but left me a little confused. I am unclear as to where the code should go seeing as I am using netbeans and much of the code defining the text fields has already been defined, nor do i know if it is possible to define through Netbeans' interface.

I was thinking maybe I have to create a textField ActionPerformed method and put the code in there, although I am unsure.

Can anyone help me?

Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is old... sorry, but it came up in my google search.

I came across a similar situation. NetBeans' GUI builder does not seem to have any way to do this so you might have to add it with another editor manually if that's exactly what you need.

Looky! I'm being abducted by space aliens! Me and this tiny ad!
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic