B4J Question Replace an existing pane

Hi Guys,
I have written the following code, which creates a pane with an image in it, which is used to represent a tool sitting in a rack (CNC Machine). The code gets its info from data in a TableView.
This works well for any new tools I add, but I now want to be able to edit existing entries or possibly even delete entries.
So my question is.... how do I delete a pane once I have created it from code.
B4X:
Sub displayToolImage(S As Int, P As Int, T As Int)
 Dim toolImagePane As AnchorPane
 toolImagePane.Initialize("")
 Dim pos(11) As Int
 
 pos(0) = (ivHolderSpindle.left + (ivHolderSpindle.Width/2))
 pos(1) = (ivHolder1.left + (ivHolder1.Width/2))
 pos(2) = (ivHolder2.left + (ivHolder2.Width/2))
 pos(3) = (ivHolder3.left + (ivHolder3.Width/2))
 pos(4) = (ivHolder4.left + (ivHolder4.Width/2))
 pos(5) = (ivHolder5.left + (ivHolder5.Width/2))
 pos(6) = (ivHolder6.left + (ivHolder6.Width/2))
 pos(7) = (ivHolder7.left + (ivHolder7.Width/2))
 pos(8) = (ivHolder8.left + (ivHolder8.Width/2))
 pos(9) = (ivHolder9.left + (ivHolder9.Width/2))
 pos(10) = (ivHolder10.left + (ivHolder10.Width/2))
 
 Select Case True
  Case S = 1
      MainForm.RootPane.AddNode(toolImagePane,(pos(P)-21) ,105,64,185)
   CSSUtils.SetBackgroundImage(toolImagePane, File.DirAssets, "EndMillsmall.png")
   Log(File.DirAssets)
   toolImagePane.Visible = True
  Case S = 2
   MainForm.RootPane.AddNode(toolImagePane,(pos(P)-51) ,101,128,128)
   CSSUtils.SetBackgroundImage(toolImagePane, File.DirAssets, "FaceMill_45.png")
   Log(File.DirAssets)
   toolImagePane.Visible = True
  Case S = 3
   MainForm.RootPane.AddNode(toolImagePane,(pos(P)-57) ,105,128,128)
   CSSUtils.SetBackgroundImage(toolImagePane, File.DirAssets, "FaceMill.png")
   Log(File.DirAssets)
   toolImagePane.Visible = True
 End Select
End Sub
 
Top