JTree

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mitch Williams

    JTree

    I've been working with a JTree based on a custom TreeModel.
    Unfortunatly, I cant figure out how to force it to update the entire
    tree-- there simply dosnt seem to be a way to say "OK, your data changed
    so drastically, it's not even worth me telling you where to start".

    I have tried the fireTreeStructu reChanged event, but that only updates
    the tree structure, leaving nodes that have changed only by name
    unchanged and me cursing. I've also tried firing multiple events;
    combinations of StructureChange d, and NodeChanged, and _almsot_ got what
    I wanted.

    Could someone give me an overview of what I need to do eventwise to
    update the entire tree?

  • Chris Esposito

    #2
    Re: JTree


    "Mitch Williams" <codewarrior123 @cox.net> wrote in message
    news:9Drbb.3084 $Rd4.805@fed1re ad07...[color=blue]
    > I've been working with a JTree based on a custom TreeModel.
    > Unfortunatly, I cant figure out how to force it to update the entire
    > tree-- there simply dosnt seem to be a way to say "OK, your data changed
    > so drastically, it's not even worth me telling you where to start".
    >
    > I have tried the fireTreeStructu reChanged event, but that only updates
    > the tree structure, leaving nodes that have changed only by name
    > unchanged and me cursing. I've also tried firing multiple events;
    > combinations of StructureChange d, and NodeChanged, and _almsot_ got what
    > I wanted.
    >
    > Could someone give me an overview of what I need to do eventwise to
    > update the entire tree?
    >[/color]

    How about if you set the data model for the JTree to null, then re-set it to
    the new, changed data model?

    Chris


    Comment

    • Mitch Williams

      #3
      Re: JTree

      Chris Esposito wrote:[color=blue]
      > "Mitch Williams" <codewarrior123 @cox.net> wrote in message
      > news:9Drbb.3084 $Rd4.805@fed1re ad07...
      >[color=green]
      >>I've been working with a JTree based on a custom TreeModel.
      >>Unfortunatl y, I cant figure out how to force it to update the entire
      >>tree-- there simply dosnt seem to be a way to say "OK, your data changed
      >>so drastically, it's not even worth me telling you where to start".
      >>
      >>I have tried the fireTreeStructu reChanged event, but that only updates
      >>the tree structure, leaving nodes that have changed only by name
      >>unchanged and me cursing. I've also tried firing multiple events;
      >>combination s of StructureChange d, and NodeChanged, and _almsot_ got what
      >>I wanted.
      >>
      >>Could someone give me an overview of what I need to do eventwise to
      >>update the entire tree?
      >>[/color]
      >
      >
      > How about if you set the data model for the JTree to null, then re-set it to
      > the new, changed data model?
      >
      > Chris
      >
      >[/color]
      Dosn't appear to work; I'd like to steer clear of recreating the
      component itself, because I know it can be done without going to that
      extreme.

      thanks tho.

      Comment

      Working...