求大神高手指导怎么让输出结果的字体变大 谢谢
import java.awt.Color;import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Panel;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class cny {
/**
* @param args
* @param TimesRoman
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Frame w=new Frame();
w.setSize(300, 500);
//w.setBackground(Color.black);
Mypanle my=new Mypanle();
w.add(my);
Thread k=new Thread(my);
k.start();
w.addKeyListener(my);
my.addKeyListener(my);
w.show();
}
}
class Mypanle extends Panel implements Runnable,KeyListener{
int x[]=new int[10];
int y[]=new int[10];
char c[]=new char[10];
Mypanle(){
for(int i=0;i<10;i++)
{
x[i]=(int)(Math.random()*270);
y[i]=(int)(Math.random()*270);
c[i]=(char)(Math.random()*26+97);
}
}
public void paint(Graphics g){
//g.setColor(Color.white);
for(int i=0;i<10;i++)
{
g.drawString(new Character(c[i]).toString(), x[i], y[i]);
}
}
@Override
public void run() {
// TODO Auto-generated method stub
while(true){
for(int i=0;i<10;i++){
y[i]++;
if(y[i]>500){
y[i]=0;
x[i]=(int)(Math.random()*270);
c[i]=(char)(Math.random()*26+97);
}
}
try{
Thread.sleep(30);
}
catch(Exception e){}
repaint();
}
}
@Override
public void keyPressed(KeyEvent arg0) {
// TODO Auto-generated method stub
char keyc=arg0.getKeyChar();
for(int i=0;i<10;i++){
if(keyc==c[i]){
y[i]=0;
x[i]=(int)(Math.random()*270);
c[i]=(char)(Math.random()*26+97);
break;
}
}
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
}
}
补充:Java , Java EE