wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes I want to handle an array of JTextFields to insert in to a TextArea when a given button is pushed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "I want to handle an array of JTextFields to insert in to a TextArea when a given button is pushed. " Watch "I want to handle an array of JTextFields to insert in to a TextArea when a given button is pushed. " New topic
Author

I want to handle an array of JTextFields to insert in to a TextArea when a given button is pushed.

Adam Cripps
Ranch Hand

Joined: Oct 01, 2011
Posts: 41

I'm having problems conceptually getting my head around how to make my application work.

I have 15 JTextField components and 15 JButton components and 1 JTextArea. I want each button to insert the text inside the textarea from each corresponding textfield.

If you wish to see a graphic to explain this setup -http://i.imgur.com/Vnc3C.png

I've managed to get frame.finaltext to the Curriculum subject class, but it is not seen inside the actionPerformed method.

What is the best way of getting a hold of frame.finaltext.append(textfields[i])

TIA
Adam

 
 
subject: I want to handle an array of JTextFields to insert in to a TextArea when a given button is pushed.
 
Similar Threads
JTabbedPane.setTitleAt not working
Null pointer exception woes
Handling methods for an object that is held in an ArrayList
Weird actionPerformed method.
Please rescue me out