|
|
|
@ -8,6 +8,7 @@ import com.fr.design.gui.ilable.UILabel;
|
|
|
|
|
import com.fr.design.gui.ispinner.UIBasicSpinner; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
import com.fr.stable.GraphDrawHelper; |
|
|
|
|
import com.fr.stable.OperatingSystem; |
|
|
|
|
import com.fr.stable.unit.CM; |
|
|
|
|
import com.fr.stable.unit.INCH; |
|
|
|
@ -53,7 +54,7 @@ public class UnitFieldPane extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//自适应label宽度
|
|
|
|
|
int width = this.getFontMetrics(this.getFont()).stringWidth(this.getText()); |
|
|
|
|
int width = GraphDrawHelper.getWidth(this.getText(), this.getFont()); |
|
|
|
|
Dimension unitDimension = new Dimension(width, preferredHeight); |
|
|
|
|
this.setMinimumSize(unitDimension); |
|
|
|
|
this.setMinimumSize(unitDimension); |
|
|
|
|