public final class ExtButtonAreaLayout
extends javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout
| Constructor and Description |
|---|
ExtButtonAreaLayout(boolean syncAllWidths,
int padding)
Constructs an
ExtButtonAreaLayout. |
| Modifier and Type | Method and Description |
|---|---|
private static int |
getMinimumButtonWidth()
Computes and answers the minimum button width.
|
void |
layoutContainer(java.awt.Container container) |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container c) |
public ExtButtonAreaLayout(boolean syncAllWidths,
int padding)
ExtButtonAreaLayout.syncAllWidths - true indicates that all buttons get the same sizepadding - the padding between buttonspublic void layoutContainer(java.awt.Container container)
layoutContainer in interface java.awt.LayoutManagerlayoutContainer in class javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayoutpublic java.awt.Dimension minimumLayoutSize(java.awt.Container c)
minimumLayoutSize in interface java.awt.LayoutManagerminimumLayoutSize in class javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayoutprivate static int getMinimumButtonWidth()
This current implementation assumes an 8pt Tahoma and honors resolutions of 96dpi and 120dpi. This leads to a good approximation of the 50dlu for the vast majority of today's target systems. And it sure is an improvement over the superclass' value of 0.
A better implementation would use a conversion from dlu to pixel
for the given buttons (that may have different font render contexts
if located in different graphics environments in a multi-screen context).
The JGoodies Forms provides such a converter and offers a better button
layout by means of the ButtonBarBuilder2 class.