Results 1 to 3 of 3
  1. #1
    Join Date
    May 2008
    Posts
    9
    Rep Power
    0

    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 08:09 AM.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    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.
    Java 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);
    }

  3. #3
    Join Date
    May 2008
    Posts
    9
    Rep Power
    0

    Default

    Thanks for your help their, i had not heard of the 'append' function before.
    Thanks heaps.

Similar Threads

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •