Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Add component to Custom Control's child component  RSS feed

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a custom control which is a Titled Etched Border Container, i have successfully created the control and added it into scene builder.

But when i try to add components into the custom control, the components are adding into the parent container of the custom control which is "AnchorPane" in this case, where as i want to add it into the child container "Pane" of the custom control.


HFXGroupPane.java



HFXGroupPane.fxml



hfx-group-pane.css



HFXGroupPaneEx.java (Sample file to check the custom control)
CustomControlSceneBuilder.png
[Thumbnail for CustomControlSceneBuilder.png]
CustomControlUse1.png
[Thumbnail for CustomControlUse1.png]
CustomControlUse2.png
[Thumbnail for CustomControlUse2.png]
 
Rancher
Posts: 296
6
Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just a mather of draging it in the right position...
I kind of think it's a weird question... why don't  you just change it in you fxml file yourself instead of trying to achieve it with scenebuilder?
 
Sheriff
Posts: 4964
136
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Demesmaecker wrote:It's just a mather of draging it in the right position...


No, the OP dragged the child component onto the custom component, as you can see in the screen shot

I kind of think it's a weird question... why don't  you just change it in you fxml file yourself instead of trying to achieve it with scenebuilder?


It's not weird at all.  Many people want to use SceneBuilder, not write FXML code.

To the OP:  I will try to take a look at this soon.  Is it still a problem or have you given up?
 
Daniel Demesmaecker
Rancher
Posts: 296
6
Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It's not weird at all.  Many people want to use SceneBuilder, not write FXML code.



I do most of the design in Scenebuilder aswell, but he posted his fxml-file, so it dosn't take to mutch work or knoweledge of fxml to cut the component and paste it in the right pane.
 
Knute Snortum
Sheriff
Posts: 4964
136
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OP: I'm pretty sure that what you want to do is impossible.  If I just look at HFXGroupPane.fxml, what I see is a custom AnchorPane with a StackPane inside.  I don't see any reason that added controls would go in the StackPane unless you added them to the Stack Pane.
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!