• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

How to create new items and show in scene JavafX?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I want to add and remove new items on menu click. Now here is my menu

 

Now I have a scene but in the same scene on clicking m1 I want to create textArea and add to scene and validate user input on click OK

   

Its giving long lists of exceptions

.....
 
Bartender
Posts: 242
27
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, welcome to the Ranch!

The issue causing the exception is that your Group contains "newBox" because of this line:

And you are also trying to add the group to newBox here:

In JavaFX, this sort of circular dependency is not allowed.

However even if you get this fixed, it doesn't look like the code in the m1 action really does anything. It creates a new VBox and Group, but doesn't end up doing anything with them, so you'll never see those items anywhere. I'd recommend not creating new elements, and rather have the elements exist immediately and hide them. Then in the m1 code, you can un-hide them.
 
Mohammad Rahman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!


Zachary Griggs wrote:Hey, welcome to the Ranch!

The issue causing the exception is that your Group contains "newBox" because of this line:

And you are also trying to add the group to newBox here:

In JavaFX, this sort of circular dependency is not allowed.

However even if you get this fixed, it doesn't look like the code in the m1 action really does anything. It creates a new VBox and Group, but doesn't end up doing anything with them, so you'll never see those items anywhere. I'd recommend not creating new elements, and rather have the elements exist immediately and hide them. Then in the m1 code, you can un-hide them.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic