Reply
Java Help!
Old 02-15-2006, 12:31 AM Java Help!
abeMING's Avatar
Novice Talker

Posts: 9
In java swing or GUI, commonly when we want to read some text or string form textfield we have use to use button..example:

String Text;
JTextField Field;
//when button clicked
if(e.getSource==Button)
{
Text = Field.getText();
}

Instead of using this method, how to read the string from textfield when users press enter?
abeMING is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-16-2006, 02:31 PM Re: Java Help!
QiSoftware's Avatar
Skilled Talker

Posts: 62
Location: U.S.
You need to attach a component listener to the widget and then use getText to retrieve the information when the enter key activates the callback.

Q...
QiSoftware is offline
Reply With Quote
View Public Profile Visit QiSoftware's homepage!
 
Old 02-21-2006, 09:44 PM Re: Java Help!
abeMING's Avatar
Novice Talker

Posts: 9
Thanx..its working...
abeMING is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Java Help!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13042 seconds with 12 queries