2 Replies - 1027 Views - Last Post: 07 February 2011 - 07:09 AM Rate Topic: -----

#1 xanimeangiex  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 20-November 10

How to use TextListeners with JTextField?

Posted 06 February 2011 - 06:32 AM

Ok. Basically, I'm making a text rpg game and I don't know how to make a command in the game, so when the user enters it while the program is running, the program responds to it.

I think I'm supposed to be using Text Listener(), but I don't know how to use it. I've searched online to no avail; does anyone here know how to use it?

Before anyone answers, the thing I'm trying to do (if you remember Zork) is the "when the user enters 'north' the program responds to it by putting them in a different room" type of thing.

If text listener isn't used, could anyone tell me how it's done?

Please and Thank you :helpsmilie:

Is This A Good Question/Topic? 0
  • +

Replies To: How to use TextListeners with JTextField?

#2 xanimeangiex  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 20-November 10

Re: How to use TextListeners with JTextField?

Posted 06 February 2011 - 10:55 AM

I should probably make this clearer..

I want to know How to validate text from JTextfield?
Was This Post Helpful? 0
  • +
  • -

#3 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: How to use TextListeners with JTextField?

Posted 07 February 2011 - 07:09 AM

Use TextListener to listen for text changes in your JTextField.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1