JList and XML!? Need advice!

Discussion in 'Java' started by Tobi Krausl, Nov 21, 2003.

  1. Tobi Krausl

    Tobi Krausl Guest

    Hi!

    I wrote an application which uses a class based upon JAXP/DOM to
    manage some kind of status-information which is updated frequently.
    I've named this class XMLTool. It contains methods to
    insert/update/delete nodes in a DOM-Tree:

    class XMLTool {
    //Construct and handle DOM-Tree
    public static boolean insertItem(...)
    public static boolean updateItem(...)
    public static boolean deleteItem(...)
    ....
    }

    Now I want that class to be the data-model for a JList used in my
    gui-component. This means that the content displayed by a JList is
    automatically updated when data in the DOM-Tree changes.

    1. How can I handle that?
    Do I just have to subclass AbstractListModel or is there anything else
    to do?

    2. How to organize the class-structure?
    Should the XMLTool-class itself act as a ListModel like

    class XMLTool extends AbstractListModel {
    .....
    implement XML-processing-logic as well as ListModel-logic?
    .....
    }

    or should there be some kind of wrapper-class? If there should be a
    wrapper, how should the class-structure look like?


    Thank you,
    Tobi
     
    Tobi Krausl, Nov 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tobi Krausl
    Replies:
    0
    Views:
    1,815
    Tobi Krausl
    Nov 12, 2003
  2. Tobi Krausl
    Replies:
    0
    Views:
    636
    Tobi Krausl
    Nov 20, 2003
  3. =?ISO-8859-15?Q?Martin_M=FCcke?=

    Jlist - ListModel and CellRenderer

    =?ISO-8859-15?Q?Martin_M=FCcke?=, Oct 17, 2006, in forum: Java
    Replies:
    1
    Views:
    785
    Thomas Hawtin
    Oct 17, 2006
  4. evgchech
    Replies:
    0
    Views:
    797
    evgchech
    Feb 26, 2007
  5. Knute Johnson

    Generic JList and ListCellRenderer?

    Knute Johnson, Dec 28, 2012, in forum: Java
    Replies:
    3
    Views:
    522
    Knute Johnson
    Dec 30, 2012
Loading...

Share This Page