This content has been marked as final. Show 5 replies
1 person found this helpful
acepsut wrote:It's a Label over an HBox which is squeezed by setting its maxHeight to a little value.
I am using Scene Builder and I would like to replicate the inspector look.
1) Are Padding, size, position areas ...etc panels within a Scroll Pane or are just two separators with a label in between ? It looks like a Swing TitledBorder Jpanel.
Something close to this:
<StackPane prefHeight="-1.0" xmlns:fx="http://javafx.com/fxml">
<HBox maxHeight="2.0" prefHeight="-1.0" prefWidth="-1.0" style="-fx-background-color: gray;-fx-background-insets: -1 -17 1 -17, 0 -17 1 -17;" />
<Label style="-fx-font-weight: bold;-fx-background-color: white;-fx-padding: 0 6 5 6;" text="Title" />
2) In case of panels, what has been used and how to set a title ?Will try to find out.
3) Is there a naming convention for fx:id field? I have only find some examples all written in lowercase such as "maintabbedpane".I am not aware of any.
fx:id can be considered as java variable name.
So using camel case seems natural to me.
I have tried to replicate your suggestion but what I get is different from inspector look.
The inspector seems very much like a group of Swing Jpanels TitledPanes.
May be I misunderstood your question.
Let's agree on naming ; if you select the default anchor pane, Inspector shows 4 levels:
Sub-sections are represented by the HBox + Label I mentioned previously.
Inspector <- Panel Properties <- Section Node <- Sub-section Disable <- Property
A section is represented by a TitledPane (which itself includes a GridPane).
TitledPane instances (Properties, Layout, Code) are grouped in an Accordion.
The Inspector header ("Inspector" + the search box + the menu) is based on an HBox
and lots of css.
I think I have not clearly explain my question:
I have uploaded a picture here
In this case I have drawn two red arrows in the Node area: this seems like a Swing TitledPane.
Is this a panel or is just a label between two separators?
I confirm : it's the combination of HBox + Label that I mentioned above.
You may observed a different look because of CSS though.