Results 1 to 3 of 3
  1. #1
    msambasiva is offline Member
    Join Date
    Jun 2013
    Posts
    18
    Rep Power
    0

    Default Save JTable rows as favorites - Design Suggestion

    Hi,

    We have developed a Swing window with different components. We have selected few check boxes and the populating JTable by fetching the DB on button click action.

    Now, we need to provide the check box option for each row to save the selected rows as favorates . At later point of time, user can get the favorate rows into the table on button click action.

    Please suggest the best option to save the favorates to get it later point of time.

    Thanks in advance,
    Samba.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: Save JTable rows as favorites - Design Suggestion

    A few options come to mind: if you have n rows R1, R2, ... and Rn and their primary keys PK1, PK2 ... PKn, construct another table with rows R'i = PKi; i.e. the other tables can contain the primary keys of the first table; the second table is your table of favourites. The second (more clumsy) option is to add a simple field Fi to each row Ri and set field Fi to true if Ri is a favourite row.

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  3. #3
    msambasiva is offline Member
    Join Date
    Jun 2013
    Posts
    18
    Rep Power
    0

    Default Re: Save JTable rows as favorites - Design Suggestion

    Thanks Jos.
    I think, first option suites for me. Because,I need to maintain favourites for each user who is using this application.i might need to maintain a separate table with key as row key and second column as comma separated user ids who has selected that row as favourite. But it might be costly fetch while getting all favourites for a particular user. Let me try out this.

    Regards,
    Samba.

Similar Threads

  1. Please help ..Architecture Design Suggestion Needed
    By Techzfreak in forum Web Frameworks
    Replies: 1
    Last Post: 08-01-2014, 09:17 AM
  2. Filtering rows in JTable
    By Rafiqul in forum New To Java
    Replies: 0
    Last Post: 12-15-2013, 05:58 PM
  3. JTable, put a listener in the rows !
    By Otyugh in forum New To Java
    Replies: 3
    Last Post: 12-31-2012, 07:54 PM
  4. Jtable rows
    By riddhishah28 in forum AWT / Swing
    Replies: 3
    Last Post: 02-18-2011, 06:24 AM
  5. display rows in jtable
    By osval in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 08:54 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
  •