• 大小: 15KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-17
  • 语言: Java
  • 标签: 源代码  java  机器人  

资源简介

很有趣的机器人小叮当java源代码! 不容错过!

资源截图

代码片段和文件信息

package rebot;

import java.awt.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
import javax.swing.plaf.metal.*;
import java.net.URL;
import rebot.SplashScreen;

public class Application {


    boolean packframe = false;
    public static String name = new String();
    public static String image = new String();
    public static Calendar calendar = Calendar.getInstance();
    public static String fulltime = calendar.get(Calendar.YEAR) + “-“ +
                                    (calendar.get(Calendar.MONTH) + 1) + “-“ +
                                    calendar.get(Calendar.DATE) + “ “ +
                                    calendar.get(Calendar.HOUR_OF_DAY) + “:“ +
                                    calendar.get(Calendar.MINUTE) + “:“ +
                                    calendar.get(Calendar.SECOND);

    public static String filetime = ““ + calendar.get(Calendar.YEAR) + “-“ +
                                    (calendar.get(Calendar.MONTH) + 1) + “-“ +
                                    calendar.get(Calendar.DATE);


    /**
     * Construct and show the application.
     */
    public Application() {

        Mainframe frame = new Mainframe();
        URL url = getClass().getResource(“/image/logo.png“);
        frame.setIconImage(new ImageIcon(url).getImage());
        // Validate frames that have preset sizes
        // Pack frames that have useful preferred size info e.g. from their layout
        if (packframe) {
            frame.pack();
        } else {
            frame.validate();
        }

        // Center the window
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
        }
        if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
        }
        frame.setLocation((screenSize.width - frameSize.width) / 2
                          (screenSize.height - frameSize.height) / 2);
        frame.setVisible(true);
        frame.jTextArea2.grabFocus();

    }

    /**
     * Application entry point.
     *
     * @param args String[]
     */
    public static void main(String[] args) throws Exception {
        SplashScreen splash = new SplashScreen(4400);
        splash.showSplashAndExit();
        try {
            Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver“);
            String dburl =
                    “jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=data/user.mdb“; //此为NO-DSN方式
            Connection conn = DriverManager.getConnection(dburl);
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery(
                    “select selectedusernameimagelanguage from userdb order by num DESC“);
            if (rs.next()) {
                String select = rs.getString(1).trim

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4705  2007-12-26 17:36  rebot\Application.java

     文件       2240  2007-12-26 17:19  rebot\help.java

     文件       1999  2007-12-26 17:31  rebot\input.java

     文件       5040  2007-12-26 17:31  rebot\language.java

     文件      42179  2007-12-26 18:06  rebot\Mainframe.java

     文件      16152  2007-12-26 18:06  rebot\set.java

     文件       1063  2007-12-26 15:25  rebot\SplashScreen.java

     文件       1015  2007-12-26 15:25  rebot\userdata.java

     目录          0  2007-12-26 21:03  rebot

----------- ---------  ---------- -----  ----

                74393                    9


评论

共有 条评论