Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2008, 09:03 AM
Member
 
Join Date: May 2008
Posts: 9
Rep Power: 0
Judoon_Platoon is on a distinguished road
Lightbulb [SOLVED] Creating List of Values Using ClipBoard Object
Hey, little problem I am trying to solve.

I have a bunch of checkboxes and some ComboBoxes which the user selects in my application, all the necessary information i need gets passed into a variable, then when the user presses a button, that info gets put into a TextArea. Basically all I need is for every time the user pushes the button, the information from the variable gets put into the TextArea again, and since the info in the variable changes when the user selects different options, it will create a list of different selections.

I am using a system clipboard object, but I can't seem to make it add the value to the TextArea, not just replace the old value.

(BTW I am very begginer Java programer)

Last edited by Judoon_Platoon; 05-19-2008 at 09:09 AM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 05-20-2008, 11:43 PM
hardwired's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 1,577
Rep Power: 4
hardwired is on a distinguished road
Default
The Clipboard is used for data transfer; mostly cut, copy and paste operations. There's no need to use it for what you are describing.
Code:
JTextArea textArea;

// ActionListener for your JButton
public void actionPerformed(ActionEvent e) {
    // get the selection state of all of your checkBoxes and comboBoxes
    // make up a string with the desired info
    textArea.setText(yourString);
    // or if you want to preserve previous entries
    textArea.append(yourString);
}
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-21-2008, 09:07 AM
Member
 
Join Date: May 2008
Posts: 9
Rep Power: 0
Judoon_Platoon is on a distinguished road
Default
Thanks for your help their, i had not heard of the 'append' function before.
Thanks heaps.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Comparable object Java Tip java.lang 0 04-15-2008 08:38 PM
List views, a type of object Leprechaun New To Java 2 02-06-2008 04:07 AM
Getting values of an Option List mutuah Advanced Java 0 08-07-2007 04:42 AM
how to remove an object from the array list cecily New To Java 3 08-02-2007 03:26 PM
Creating object of Type Object class venkatv New To Java 3 07-17-2007 04:33 PM


All times are GMT +2. The time now is 04:24 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org