Results 1 to 2 of 2
  1. #1
    bhaskaranbe is offline Member
    Join Date
    Jun 2015
    Posts
    7
    Rep Power
    0

    Default how to set the object arraylist values to ObservableList

    i want to create object observable list for tables, for that how should i get values from object arrayList.

    public final ObservableList<Person> data=null;

    and I have array list for class Description: List<Description> dp=new ArrayList<Description>();

    Description des=new Description();

    des.setDescription(Strings, Stringval2, Stringval3);
    dp.add(des);

    how should i use this list "dp" values to "ObservableList"


    The code is:

    public class Description {

    public String Name;
    public String lastname;
    public String Date;


    public Description() // empty constructor
    {
    }
    public Description(String d, String m, String ds)
    {
    this.name=d;
    this.lastname=m;
    this.Date=ds;

    }

    public void setDescription(String d, String m, String ds)
    {
    this.name=d;
    this.lastname=m;
    this.Date=ds;
    }

    public String getName() {
    return name;
    }
    public void setName(String name) {
    this.name = name;
    }
    public String getDate() {
    return Date;
    }
    public void setDate(String Date) {
    this.Date = Date;
    }
    public String getLastname() {
    return lastname;
    }
    public void setlastname(String lastname) {
    this.lastname = lastname;
    }

    }

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: how to set the object arraylist values to ObservableList

    You didn't even return to your previous question.

    http://www.java-forums.org/new-java/...ng-javafx.html

    If you just ask questions and then completely ignore them, you don't really make people willing to invest time into trying to help you.

    In any case its not really clear to me what exactly you want to do here. What do you mean by how should i use this list "dp" values to "ObservableList" ? One stores Person objects and the other stores Description objects, what is the role of the Person class in this incomplete story you're telling here? Is that code you just copy/pasted from somewhere?

    EDIT:

    and please, wrap your code in [code][/code] tags so it becomes a lot more readable.

    http://www.java-forums.org/misc.php?do=bbcode#code
    Last edited by gimbal2; 07-28-2015 at 02:51 PM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 3
    Last Post: 04-17-2015, 07:48 PM
  2. Storing object with int values in Arraylist.
    By Zigster in forum New To Java
    Replies: 12
    Last Post: 05-26-2012, 09:49 PM
  3. Replies: 2
    Last Post: 11-16-2010, 05:51 PM
  4. Replies: 3
    Last Post: 03-15-2010, 08:44 PM
  5. Replies: 1
    Last Post: 03-04-2009, 06:14 PM

Tags for this Thread

Posting Permissions

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