• 大小: 7.86MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-21
  • 语言: Html/CSS
  • 标签: 优秀  

资源简介

完整的前端代码 图书管理系统~~

资源截图

代码片段和文件信息


package studentbooking.applications;

import studentbooking.db.DBHelper;
import studentbooking.bean.OperatorEntity;
import studentbooking.bean.StudentEntity;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;

import static javafx.geometry.HPos.LEFT;

/**
 * Created by leiYang on 2016/11/27.
 */
public class Login extends Application {

    @Override
    public void start(Stage primaryStage) {
        primaryStage.settitle(“学生火车票订票系统“);
        GridPane grid = new GridPane();
        grid.setAlignment(Pos.CENTER);
        grid.setHgap(10);
        grid.setVgap(10);
        grid.setPadding(new Insets(10 25 40 25));

        Text scenetitle = new Text(“欢迎使用!“);
        scenetitle.setFont(Font.font(22));
        grid.add(scenetitle 0 0 2 1);

        Label userName = new Label(“   用户名:“);
        grid.add(userName 0 2);

        TextField userTextField = new TextField();
        grid.add(userTextField 1 2);

        Label pw = new Label(“      密码:“);
        grid.add(pw 0 3);

        PasswordField pwBox = new PasswordField();
        grid.add(pwBox 1 3);

        Label lt = new Label(“登陆选项:“);
        grid.add(lt 0 4);

        ChoiceBox choiceBox = new ChoiceBox(FXCollections.observableArrayList(“普通用户““操作员“));
        choiceBox.setValue(“普通用户“);
        grid.add(choiceBox14);


        Button btn = new Button(“  登陆  “);
        btn.getstyleClass().add(“button5“);
        HBox hbBtn = new HBox(10);
        hbBtn.setAlignment(Pos.BOTTOM_RIGHT);
        hbBtn.getChildren().add(btn);
        grid.add(hbBtn 1 6);

        final Text actiontarget = new Text();
        grid.add(actiontarget 0 6);
        grid.setColumnSpan(actiontarget 2);
        grid.setHalignment(actiontarget LEFT);
        actiontarget.setId(“actiontarget“);

        btn.setOnAction(new EventHandler() {
            @Override
            public void handle(ActionEvent e) {

                String account = userTextField.getText().toString();
                String password = pwBox.getText().toString();
                String choice = choiceBox.getValue().toString();
                System.out.println(choice);
                DBHelper dbHelper = new DBHelper();

                if (choice.equals(“普通用户“)){

                    dbHelper.executeSQL(“SELECT * FROM Student where(name=‘“+account+“‘ and password=‘“+password+“‘)“);
                    ResultSet resultSet = dbHelper.getResultSet();
                    DBHelper dbHelper1 = new DBHelper();
                   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-12-01 08:08  StudentBookingSystem-master\
     目录           0  2016-12-01 08:08  StudentBookingSystem-master\.idea\
     文件         524  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources.xml
     目录           0  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\
     文件       12078  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66.xml
     目录           0  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\
     目录           0  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\
     文件       65536  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\metadata
     文件        4096  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\metadata.keystream
     文件           8  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\metadata.keystream.len
     文件           8  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\metadata.len
     文件         116  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\metadata.values.at
     文件       32768  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\metadata_i
     文件           8  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\_metadata_\metadata_i.len
     文件         122  2016-12-01 08:08  StudentBookingSystem-master\.idea\dataSources\9c5ee45e-2e4f-4c1c-a26a-ccfdbaf4fe66\storage.xml
     目录           0  2016-12-01 08:08  StudentBookingSystem-master\.idea\libraries\
     文件        1309  2016-12-01 08:08  StudentBookingSystem-master\.idea\libraries\Hibernate_5_2_3_5_2_3.xml
     文件         235  2016-12-01 08:08  StudentBookingSystem-master\.idea\libraries\sqljdbc4.xml
     文件         273  2016-12-01 08:08  StudentBookingSystem-master\.idea\misc.xml
     文件         280  2016-12-01 08:08  StudentBookingSystem-master\.idea\modules.xml
     文件        8792  2016-12-01 08:08  StudentBookingSystem-master\.idea\uiDesigner.xml
     文件         180  2016-12-01 08:08  StudentBookingSystem-master\.idea\vcs.xml
     文件        1692  2016-12-01 08:08  StudentBookingSystem-master\License.txt
     文件        1962  2016-12-01 08:08  StudentBookingSystem-master\README.md
     文件        1043  2016-12-01 08:08  StudentBookingSystem-master\StudentBookingSystem.iml
     文件        3551  2016-12-01 08:08  StudentBookingSystem-master\build.xml
     目录           0  2016-12-01 08:08  StudentBookingSystem-master\lib\
     文件      445288  2016-12-01 08:08  StudentBookingSystem-master\lib\antlr-2.7.7.jar
     文件       70701  2016-12-01 08:08  StudentBookingSystem-master\lib\cdi-api-1.1.jar
     文件       64110  2016-12-01 08:08  StudentBookingSystem-master\lib\classmate-1.3.0.jar
     文件      313898  2016-12-01 08:08  StudentBookingSystem-master\lib\dom4j-1.6.1.jar
............此处省略58个文件信息

评论

共有 条评论