Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 9
Trades: 0
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
 
 
Register now for full access!
Old 02-16-2006, 02:31 PM Re: Java Help!
QiSoftware's Avatar
Skilled Talker

Posts: 74
Location: U.S.
Trades: 0
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...
__________________


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
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
Trades: 0
Thanx..its working...
abeMING is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Java Help!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.20885 seconds with 12 queries