繪製文字

託帕發表於2018-09-16
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame{

	Wdmb2 mb=null;

	public static void main(String[] args) throws Exception{

		Test lx=new Test();	
	}

	public Test(){
		mb=new Wdmb2();
		this.add(mb);
		this.setSize(400,300);
		this.setLocation(300,280);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
	}
}



class Wdmb2 extends JPanel{
	public void paint(Graphics g){
		g.setColor(Color.cyan);
		g.setFont(new Font("華文彩雲",Font.BOLD,50));
		g.drawString("你好",200,200);
	}
}

相關文章