myframe.java

来自「java绘图 java awt 经典绘图的例子,对于初学awt模块的人非常有帮助」· Java 代码 · 共 37 行

JAVA
37
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package awt;import java.awt.Button;import java.awt.Color;import java.awt.Dimension;import java.awt.Font;import java.awt.Frame;import java.awt.Graphics;import java.awt.Panel;import java.util.logging.Level;import java.util.logging.Logger;/** * * @author zhaolin */public class MyFrame extends Frame {    @Override    public void paint(Graphics g) {        super.paint(g);        Font f = new Font("黑体",Font.BOLD+Font.ITALIC,20);        g.setFont(f);        g.drawString("World", 200, 200);    }    public static void main(String[] args) {        MyFrame f = new MyFrame();        f.setSize(300,240);        f.setVisible(true);    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?