- //start.java
- package abc.jdm;
- import javax.swing.*;
- import java.awt.Toolkit;
- import java.awt.Dimension;
- import java.awt.Image;
- import java.awt.GridLayout;
- public class start extends JFrame
- {
- JWindow window;
- public start()
- {
- window=new JWindow(this);
- Image logo=Toolkit.getDefaultToolkit().getImage("F://myjava//myframe//src//abc//jdm//logo.jpg");
- Dimension scrSize=Toolkit.getDefaultToolkit().getScreenSize();
- JPanel p = new JPanel(new GridLayout(2,1));
- JLabel a = new JLabel("******** 欢迎使用本软件,/n 版权所有:孟德军 *********",JLabel.CENTER);
- JLabel b = new JLabel(new ImageIcon(logo),JLabel.CENTER);
- p.add(b);
- p.add(a);
- window.add(p,"Center");
- window.setLocation(scrSize.width/4,scrSize.height/4);
- window.setSize(scrSize.width/3+50,scrSize.height/3);
- window.show();
- window.toFront();
- try{Thread.currentThread().sleep(2000);
- //Thread.currentThread();可以获得主线程的一个应用。
- MyFrame myframe=new MyFrame();
- }
- catch(Exception e){e.printStackTrace();}
- window.dispose();
- }
- /*public static void main(String[] args)
- {
- start win=new start();
- } */
- }
java 记事本本源代码.
最新推荐文章于 2021-02-12 19:06:21 发布