JAVAFX 游戏排行榜(Mysql与JDBC)

JAVAFX梭哈游戏排行榜(Mysql与JDBC)

实验内容

在Mysql数据库中创建数据库showhand,同时创建表users,表字段内容参考下图,使用Swing/awt/JavaFx创建下面图表,使用JDBC知识完成以下功能:
显示所有数据表users中的全部记录;
根据昵称查询users符合条件的用户列表;

在这里插入图片描述

布局图

在这里插入图片描述

现实部分

在这里插入图片描述

MainUI 代码



package ShowHand;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javafx.application.Application;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.TableColumn.CellDataFeatures;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.util.Callback;

public class MySqlTableUI extends Application{
   

	public static void main(String[] args) {
   
		// TODO Auto-generated method stub
		launch(args);
	}
	public void start(Stage stage) throws Exception{
   
		
		ObservableList<Person> persons = FXCollections.observableArrayList();
		
		
		//TableView table = new TableView();
		//与数据库建立联系,读取数据
		Class.forNa
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值