java程序(10行),不成功,求解释
packagefactory211;importjava.applet.*;importjava.awt.*;importjava.awt.event.*;importj...
package factory211;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Gmain extends JFrame
{
Image im1;
private static Toolkit tk= Toolkit.getDefaultToolkit();
public void paint(Graphics g)
{
im1 = tk.getImage("p1.GIF");
g.drawImage(im1,0,0,this);
}
public static void main(String a[]){
Gmain gm=new Gmain();
gm.setSize(900,650);
gm.setVisible(true);
}
}
运行后,只出一个框,中间透明,电脑呈假死状态 展开
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Gmain extends JFrame
{
Image im1;
private static Toolkit tk= Toolkit.getDefaultToolkit();
public void paint(Graphics g)
{
im1 = tk.getImage("p1.GIF");
g.drawImage(im1,0,0,this);
}
public static void main(String a[]){
Gmain gm=new Gmain();
gm.setSize(900,650);
gm.setVisible(true);
}
}
运行后,只出一个框,中间透明,电脑呈假死状态 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询