• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Deleting label in vBox

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way to delete a node from inside a vBox?

So far i've tried this

vBoxName.getChildren().remove(labelVariable);

and

labelName.getParent().getChildren().remove(labelName);

but getChildren is protected in this latter case and the other doesnt seem to be working.

I'm hoping by deleting it, the other nodes will also move up in the vbox to occupy the freed space
Thanks!
removeNode.png
[Thumbnail for removeNode.png]
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In SceneBuilder, point the mouse at the node you want to remove, right-click, and select Delete.
 
John McAlpine
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an object that's going to have a bunch of randomized fields, and it may or may not contain certain fields on instantiation depending on the subclass that gets generated.

I need to be able to remove the node from the controller
 
John McAlpine
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found another solution that is less convoluted than this one, thanks again for the help
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great!  Would you mind posting your solution so that others can benefit from it?
 
John McAlpine
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a problem where there was a node (Label) in my vertical box I wanted to get rid of. I can set it to be not visible but that results in a gap in my list, I found a command called "toFront" which puts the Label at the bottom of my list, then I can set its visibility to OFF and it appears to be deleted

 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're interested in actually removing a label, here's a complete program to show you how to do that.  You would either need the Label object itself or a way of distinguishing one label from all the others.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic