Results 1 to 3 of 3
  1. #1
    tbhawk is offline Member
    Join Date
    Jul 2011
    Rep Power

    Default Return multiple values from array lookup?


    I have a small array (effectively 25 rows by about 6 columns), and I want to use a lookup function to return a subset of the array. (This is on a website).

    I have so far managed to return single entries from the array by entering a value for one of the 'column variables', but am stuck on progressing to the next step.

    Ideally I would have 6 drop down boxes, one for each of the columns, whereby a user could enter values into a couple of the boxes and return elements from the array which match the entered ranges.

    Is this fairly straightforward? If so could anyone give a skeleton of code?


  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Richmond, Virginia
    Blog Entries
    Rep Power


    You could just allocate an array, fill it, and then return the array.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power


    It does rather look like you're using arrays to perform the task of a ListSelectionModel (yes I know that's a Swing class, but that's no reason it can't be used anywhere that values in a list need to be selected/unselected). And since you're talking about columns, maybe a RowSorter (yes, it also takes care of filtering) would provide desired functionality.


Similar Threads

  1. Replies: 14
    Last Post: 06-29-2011, 03:49 PM
  2. return multiple values from class methods
    By exdox77 in forum New To Java
    Replies: 0
    Last Post: 01-29-2011, 09:08 PM
  3. java method with multiple return values
    By Ms.Ranjan in forum New To Java
    Replies: 1
    Last Post: 06-18-2009, 06:08 PM
  4. [SOLVED] Multiple return values
    By Manfizy in forum New To Java
    Replies: 17
    Last Post: 05-25-2009, 12:07 PM
  5. Using functions that return values?
    By Megapixelz in forum New To Java
    Replies: 1
    Last Post: 04-30-2008, 04:07 AM

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