package com.lovo.bean;
import java.awt.Container;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JFrame;
public class MyFrame extends JFrame {
private Container contentP;
public MyFrame(){
//this.addcontent();
Toolkit tk = Toolkit.getDefaultToolkit(); //获取默认工具包
Image img = tk.createImage("hp.JPG"); //生成图形
this.setIconImage(img); //获取图像
this.setSize(600, 400);
// int w = (tk.getScreenSize().width - 600)/2;
// int h = (tk.getScreenSize().height - 400)/2;
// this.setLocation(w, h);
this.setLocationRelativeTo(null);
this.setTitle("HiLo Game");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
}
慕姐4208626
翻翻过去那场雪
相关分类