java - Make a panel use the exact space it needs and fill in the rest with another panel -


I want to create a layout with two componenents in a vertical line, the first component is an example of my own class, The panel that expands and displays an image, and I want to take it to the right place, which requires the full picture to be displayed. The remaining space should then be filled by another component (in this case another panel with a gridlate). View pictures.

desired layout

In Android, Can do this by using, but I can not find anything like Java, and I can not see that none of the standard layout managers in Java are suitable for this.

I tried to insert ImagePanel in North Layout and other panels in the border layout. The serator, but the second panel was overlapping the image so that it would not work.

I will not even care about a grid layout but the size of the grid in the image, so I do not think that it will also work.

Any help is appreciated.

Border layout should work, provided the getPreferredSize () Returns the right dimension (i.e. displays the dimensions of the image).

Using a simple jlabble containing image icons and not a text instead of your custom image panel will do this for you.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -