JavaFX 2.0 Visualization Tool Inside Control

I am working with .net WPF. Using this library allows me to completely redesign each control. FE - I have a button, inside the button I can display a table (grid) with rows and columns. Then, on a specific cord in a table (grid), I can display an image, a shortcut, or something else.

here is an example for redesigning ListBoxItem

<Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Grid x:Name="ShortCutGrid" Height="96" HorizontalAlignment="Left" VerticalAlignment="Top" Width="96" Background="Transparent"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="96"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid Grid.Row="0"> <Image Grid.Column="1" Name="Image1" Width="48" Height="48" Source="{Binding Path=ImageName}"/> </Grid> <StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"> <Label> <TextBox Background="Transparent" x:Name="TextBox1" Text="{Binding Path=Text}" Foreground="Black" TextWrapping="WrapWithOverflow" TextAlignment="Center" BorderThickness="0" IsReadOnly="True" Focusable="False" Cursor="Arrow"> </TextBox> </Label> </StackPanel> </Grid> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="true"> <Setter TargetName="TextBox1" Property="Background" Value="Navy"/> <Setter TargetName="TextBox1" Property="Foreground" Value="White"/> <Setter TargetName="Image1" Property="OpacityMask" Value="{StaticResource ShortcutSelected}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <EventSetter Event="MouseDoubleClick" Handler="listBoxItem_DoubleClick" /> </Style> 

My question is: is it possible in JavaFX 2.0 to render controls inside another control in fxml?

0
source share
1 answer

With basic controls this is not the case. But you can create your own controls that can contain any node.

0
source

Source: https://habr.com/ru/post/925203/


All Articles