⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java~1~

📁 JBuilder2006设计的服装进销存管理系统。 只是一个Demo,但帮助文档等一应俱全。 在使用前请先将数据库中的内容加载到SQLServer2000中
💻 JAVA~1~
字号:
package com.lzw;

import javax.swing.*;
import java.awt.*;
import java.awt.image.*;

public class Main{
    public static void main(String[] args){
        new Thread(){                                                  //用于运行SplashScreen的线程
            public void run(){
                try{
                     SplashScreen splash =SplashScreen.getSplashScreen();
                     Graphics2D g =splash.createGraphics();
                     g.setColor(Color.red);
                     g.drawString(splash.getBounds().toString(),10,30);  //SplashScreen在屏幕的位置,大小
                     g.drawString(splash.getSize().toString(),10,50);    //SplashScreen的大小
                     g.drawString(splash.getImageURL().toString(),10,70);//当前显示的图片
                     splash.update();                                    //刷新以上内容到屏幕
                     Thread.sleep(1000);

                    //下面的代码是在SplashScreen上显示一个3D效果的字符串
                     g.setComposite(AlphaComposite.Clear);                                                //1
                     g.fillRect(0,0,(int)splash.getSize().getWidth(),(int)splash.getSize().getHeight());  //2
                     //splash.setImageURL(Main.class.getResource("/SplashTest/beauty.jpg"));      //更改显示的图片

                    int x =30, y=100;
                     String author ="Made By Eastsun";
                     g.setFont(new Font("TimesRoman", Font.PLAIN, 30));
                     g.setPaintMode();                                                                    //3
                    for(int i=0;i<5;i++){
                         g.setColor(new Color(200, 200, 0));
                         g.drawString(author, x+i, y+i-1);
                         g.setColor(new Color(100, 100, 0));
                         g.drawString(author, x+i-1, y+i);
                     }
                     g.setColor(Color.yellow);
                     g.drawString(author, x+5, y+5);
                     splash.update();
                     Thread.sleep(10000);                                //注意,这儿是sleep(10000),但实际上SplashScreen并没有显示10秒
                 }catch(Exception e){
                     e.printStackTrace();
                 }
             }
         }.start();

        try{
             Thread.sleep(3000);                                         //这儿决定SplashScreen显示时间长短.
         }catch(Exception e){}                                           //对于实际应用程序,这儿对应程序的初始化工作
         JFrame frame =new JFrame("Java SE6 Splash Test");
         frame.setPreferredSize(new Dimension(320,240));
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.pack();
         frame.setVisible(true);
     }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -