Results 1 to 4 of 4
  1. #1
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default feeding map into jtable

    Hi

    I want to feed a jtable with my datastructure map

    Java Code:
    Map<Object , List<Object>> myMap;
    in java tutorials i found the following

    Java Code:
    There are two JTable constructors that directly accept data (SimpleTableDemo uses the first):
    
        * JTable(Object[][] rowData, Object[] columnNames)
        * JTable(Vector rowData, Vector columnNames)
    My question is :
    Should iterate over the map and read each List . Convert the List to Vector and then add it ?

    There is also another approach i.e. to add Vector ( row data ) directly into the DataModel

    Which is best approach ?

    Regards
    kmm

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    10

    Default

    Hi, I think that best approach is implement AbstractTableModel and it use in JTable.
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default defaulttable model and abstract table model

    Hi

    thanks for that

    what s the difference between defaulttable model and abstract table model ?

  4. #4
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    10

    Default

    defaulttable extend abstracttable. It use Vector to store the cell value objects.
    Skype: petrarsentev
    http://TrackStudio.com

Similar Threads

  1. regarding deletion of spoon-feeding post
    By Fubarable in forum Forum Lobby
    Replies: 7
    Last Post: 03-18-2010, 02:46 PM
  2. Adding New JTable in JTable
    By anilkumar_vist in forum New To Java
    Replies: 0
    Last Post: 01-27-2010, 09:27 AM
  3. JTable help
    By FFEJ in forum New To Java
    Replies: 5
    Last Post: 10-06-2009, 12:30 AM
  4. Replies: 1
    Last Post: 09-10-2009, 02:58 PM
  5. Replies: 2
    Last Post: 05-15-2008, 11:15 AM

Posting Permissions

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