Similarly, calls to setRightComponent and setBottomComponent are equivalent. Calls to setLeftComponent and setTopComponent are equivalent and set the specified component in the top or left position, depending on the split pane's current split orientation. You can use any of these methods at any time regardless of the split pane's current split direction. Positioning the Divider and Restricting its RangeĪ program can set a split pane's two components dynamically with these four methods:.The rest of this section covers these topics: See Positioning the Divider and Restricting its Range for details. The range of a split pane's divider is determined in part by the minimum sizes of the components within the split pane. (Note that not all look and feels support this.) The example turned them on using the setOneTouchExpandable method. In the Java look and feel, they are turned off by default. The current look and feel determines whether these controls appear by default. These arrows let the user collapse (and then expand) either of the components with a single click. Two small arrows appear at the top of the divider in the example's split pane. You can change the split direction after the split pane has been created with the setOrientation method. Split pane provides one other option, specified with JSplitPane.VERTICAL_SPLIT, that places one component above the other. The split pane in this example is split horizontally the two components appear side by side as specified by the JSplitPane.HORIZONTAL_SPLIT argument to the constructor. Refer to Setting the Components in a Split Pane for information about JSplitPane methods that set the components dynamically. The other arguments are the two components to put in the split pane. The constructor used by this example takes three arguments. Provide minimum sizes for the two components in the split paneĭimension minimumSize = new Dimension(100, 50) SplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, Create a split pane with the two scroll panes in it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |