`

Drawing Simple Text:画简单的文本

阅读更多
<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>

// Set the desired font if different from default font.

Font font = new Font("Serif", Font.PLAIN, 12);

g2d.setFont(font);

// Draw the string such that its base line is at x, y.

g2d.drawString("aString", x, y);

// Draw the string such that the top-left corner

// is at x, y.

FontMetrics fontMetrics = g2d.getFontMetrics();

g2d.drawString(

"aString", x, y+fontMetrics.getAscent());

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics