- 306 名前:デフォルトの名無しさん mailto:sage [2007/06/09(土) 16:06:30 ]
- >>304
int x0 = 20, y0 = 20; double requestWidth = 100; String text = "ABC"; Graphics2D g2 = (Graphics2D)g; FontMetrics fm = g.getFontMetrics(); double m = requestWidth / fm.stringWidth(text); g2.translate(x0, y0); g2.scale(m, 1); g2.translate(-x0, -y0); g.drawString(text, x0, y0);
|

|