In this tutorial I'll explain how to use GridLayout. And when it comes to using layout managers (not just GridLayout):
DO NOT call setMinimumSize(), setMaximumSize() or setPreferredSize() methods for components within containers. Let some other factors to determine size of your component (like size of font or size of icon);
Avoid calling setSize() method for top level standalone containers, like JFrame, call pack() instead, so the size of your JFrame will be equal to its preferred size, which is determined by size of components within your JFrame;
If you have any question, leave it in comment section below.
Source codes available here: https://github.com/BranislavLazic/Swi...
Sur cette page du site, vous pouvez voir la vidéo en ligne Java swing GUI tutorial #17: GridLayout durée 05 minute 33 seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Lazic B. 25 février 2013, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 56,555 fois et il a aimé 168 téléspectateurs. Bon visionnage!