BorderPane (JavaFX 8) - Oracle Help Center
Có thể bạn quan tâm
Borderpanes may be styled with backgrounds and borders using CSS. See Region superclass for details.
BorderPane honors the minimum, preferred, and maximum sizes of its children. If the child's resizable range prevents it from be resized to fit within its position, it will be aligned relative to the space using a default alignment as follows:
- top: Pos.TOP_LEFT
- bottom: Pos.BOTTOM_LEFT
- left: Pos.TOP_LEFT
- right: Pos.TOP_RIGHT
- center: Pos.CENTER
BorderPane lays out each child set in the five positions regardless of the child's visible property value; unmanaged children are ignored.
Resizable Range
BorderPane is commonly used as the root of a Scene, in which case its size will track the size of the scene. If the scene or stage size has not been directly set by the application, the scene size will be initialized to the border pane's preferred size. However, if a border pane has a parent other than the scene, that parent will resize the border pane within the border pane's resizable range during layout. By default the border pane computes this range based on its content as outlined in the table below.
| width | height | |
|---|---|---|
| minimum | left/right insets plus width required to display right/left children at their pref widths and top/bottom/center with at least their min widths | top/bottom insets plus height required to display top/bottom children at their pref heights and left/right/center with at least their min heights |
| preferred | left/right insets plus width required to display top/right/bottom/left/center children with at least their pref widths | top/bottom insets plus height required to display top/right/bottom/left/center children with at least their pref heights |
| maximum | Double.MAX_VALUE | Double.MAX_VALUE |
A border pane's unbounded maximum width and height are an indication to the parent that it may be resized beyond its preferred size to fill whatever space is assigned to it.
BorderPane provides properties for setting the size range directly. These properties default to the sentinel value Region.USE_COMPUTED_SIZE, however the application may set them to other values as needed: borderPane.setPrefSize(500,400); Applications may restore the computed values by setting these properties back to Region.USE_COMPUTED_SIZE.
BorderPane does not clip its content by default, so it is possible that childrens' bounds may extend outside its own bounds if a child's min size prevents it from being fit within it space.
Optional Layout Constraints
An application may set constraints on individual children to customize BorderPane's layout. For each constraint, BorderPane provides a static method for setting it on the child.
| Constraint | Type | Description |
|---|---|---|
| alignment | javafx.geometry.Pos | The alignment of the child within its area of the border pane. |
| margin | javafx.geometry.Insets | Margin space around the outside of the child. |
Example: ListView list = new ListView(); BorderPane.setAlignment(list, Pos.TOP_LEFT); BorderPane.setMargin(list, new Insets(12,12,12,12)); borderPane.setCenter(list);
Từ khóa » Html Layout Kullanımı
-
CSS Sayfa Düzeni ( Layout ) - WebCebir
-
HTML & CSS | Layout Kullanımı - YouTube
-
Ders_22 HTML Sayfa Düzeni (Layout)
-
HTML Layout Yapısı! - ArmyYazilim
-
CSS Sayfa Düzeni (Layout) - Yazılım Bilişim Programlama
-
HTML | Layout - GeeksforGeeks
-
Html Layout Kullanımı
-
HTML Layout Elements And Techniques - W3Schools
-
HTML Responsive Web Design - W3Schools
-
15 – HTML Layouts / Sayfa Düzeni | ApocalyptRA
-
Order - CSS: Cascading Style Sheets - MDN Web Docs
-
The Aside Element - HTML: HyperText Markup Language