Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to put a JButton at the lower right corner of a JDialog with the MigLayout?  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With the MigLayout for Swing, I'd like to see the JDialog looking like the standard windows Dialog,
where to have the OK and cancel buttons at the lower right corner.
How do I achieve that?
Thanks
Jack
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why use MigLayout?

This is easily done using the standard layout managers. Use a JPanel with a FlowLayout that is right aligned. Then add the panel to the BorderLayout.SOUTH of the dialogs content pane.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:Why use MigLayout?

This is easily done using the standard layout managers. Use a JPanel with a FlowLayout that is right aligned. Then add the panel to the BorderLayout.SOUTH of the dialogs content pane.


It seems your way is better way.
Thanks
Jack
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!