package cn.ychx;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;

public class CreateWebCode extends JFrame {

	private static final long serialVersionUID = 1L;
	public static final int WIDTH = 300;
	public static final int HEIGHT = 500;
	
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable(){
			@Override
			public void run() {
				CreateWebCode cwc = new CreateWebCode();
				Toolkit kit = Toolkit.getDefaultToolkit();
				Dimension dimension = kit.getScreenSize();
				cwc.setBounds((dimension.width - WIDTH)/2, (dimension.height - HEIGHT)/2, WIDTH, HEIGHT);
				cwc.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				cwc.setVisible(true);
			}
			
		});
		
	}

	public CreateWebCode() {
		String[] columnNames = { "Name", "Flag"};
		Object[][] data = {
				{"Tom","1"},
				{"Alice","2"},
				{"Jance","3"},
				{"Babo","4"}
		};
		JTable table = new JTable(data, columnNames);
		JScrollPane scrollPane = new JScrollPane(table); 
		add(scrollPane);
	}
}

相关文章:

  • 2021-11-06
  • 2022-12-23
  • 2021-05-08
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2021-09-14
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
相关资源
相似解决方案