Table disappears on resize3/22/2023 Public Dimension minimumLayoutSize(Container target) * components contained in the specified target container. * Returns the minimum dimensions needed to layout the visible Public Dimension preferredLayoutSize(Container target) * subcomponents of the specified container * the preferred dimensions to lay out the * target the component which needs to be laid out * visible components in the specified target container. * Returns the preferred dimensions for this layout given the Public WrapLayout(int align, int hgap, int vgap) * vgap the vertical gap between components * hgap the horizontal gap between components * and the indicated horizontal and vertical gaps. * Creates a new flow layout manager with the indicated alignment * The value of the alignment argument must be one of * Constructs a new FlowLayout with the specified * alignment and a default 5-unit horizontal and vertical gap. * Constructs a new WrapLayout with a left The preferred size for this container. Public class WrapLayout extends FlowLayout * FlowLayout subclass that fully supports wrapping of components. Here is that code in case anyone is trying to do the same thing I modified your main method just a bit to see if it would work with vertical scrolling only. So if the container size does not match the size you want when layouContainer is called invalidate the target and force a relayout from the top parent container. I was attempting the same thing but having all sorts of trouble (my first attempt at a custom layout manager) and now I see that you cannot depend on minimumLayoutSize or preferredLayoutSize to be called before layoutContainer. 1.7K Training / Learning / Certification.165.3K Java EE (Java Enterprise Edition).7.9K Oracle Database Express Edition (XE).3.8K Java and JavaScript in the Database.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |