Results 1 to 4 of 4
- 11-11-2009, 08:14 PM #1
Member
- Join Date
- Nov 2009
- Posts
- 5
- Rep Power
- 0
taking data from several textfields and combining them to be one item in a JList
how would i go about collecting data from 4 JTextFields such as name,address, home num, mobile num. and then combining them into one string so they can be one item in a JList? eg
luke, highway road, 929382094, 03740324
any help would be great thanks
- 11-11-2009, 08:22 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,537
- Rep Power
- 11
Get the contents of each of the text fields, use the + operator to create a new string (or String.format()) and then add that string as an element of the list.
It's hard to see what the actual problem is here. (Unfamiliarity with String operations? with Swing? with the particular methods of lists and text fields?) Perhaps you could post your attempt.
- 11-11-2009, 08:23 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
kind regards,Java Code:JTextField tf1, tf2, tf3, tf4; ... String result= tf1.getText()+", "+tf2.getText()+", "+tf3.getText()+", "+tf4.getText();
Jos
- 11-11-2009, 09:00 PM #4
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Similar Threads
-
Buttons and TextFields
By Xystus777 in forum New To JavaReplies: 27Last Post: 03-17-2009, 01:26 AM -
how to insert data in table (stored proc) without taking all the values as parameters
By Faheem_Ahmed in forum New To JavaReplies: 0Last Post: 02-28-2009, 11:16 AM -
How can I place Buttons and TExtfields within an Applet window?
By sergioTOOL in forum JCreatorReplies: 0Last Post: 02-11-2009, 11:12 PM -
Help combining loops into 1 program.
By kewlgeye in forum New To JavaReplies: 5Last Post: 04-22-2008, 09:58 AM -
information from a textfields
By bbq in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 06-28-2007, 05:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks