This method is the one that does all the work. Note: addImpl stands for “implementation of the add method.” Protected void addImpl ( Component comp, Object constraints, int index ) You can call these methods directly to explicitly set the size information for a component. If your component is a JFC Project Swing component, you inherit three methods, setPreferredSize(Dimension), setMinimumSize(Dimension) and setMaximumSize(Dimension). Which of these methods is respected or ignored is very important information and should be documented carefully when creating your own layout manager.Ĭontrolling the sizes returned for your own components can be accomplished in two ways, depending on whether you are using the JFC Project Swing components. Each layout manager has its own algorithm and may or may not use this information when deciding component placement. Layout managers can respect or ignore as much or as little of this information as they see fit. Layout managers will use these sizing methods when they are figuring out where to place components and what size they should be. This returns the largest desired size for a component. This returns the smallest desired size for a component. This returns the desired size for a component. Each of these methods returns a Dimension object describing the requested size. The Component class defines several size accessor methods to assist the layout process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |