It really depends on which context you have. That's why there are so many differnt Layouts to chose from.
Sometimes there's many ways to build a specific design, sometimes a specific Layout will make the design very easy - but learning how the different JRE-included Layouts work is time well spent if you target Swing applications.
In your current case I'd probably use BorderLayout for the Dialog, put a JLabel in CENTER with icon and (two lines of) text and add the Buttons in another JPanel in SOUTH...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.