最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

第一

2023-06-30 10:28 作者:天塵灬厭宇  | 我要投稿

package com.yunjisuan; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.table.DefaultTableModel; import com.conn.SqlTest; import com.conn.shops; import javax.swing.JButton; import javax.swing.JDialog; import java.awt.event.ActionListener; import java.sql.SQLException; import java.util.ArrayList; import java.awt.event.ActionEvent; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JScrollPane; import java.awt.BorderLayout; import java.awt.FlowLayout; import javax.swing.JTable; import javax.swing.SwingConstants; public class first extends JFrame { private JPanel contentPane; private JTextField textField; private JTable table; private Object[][]data; private String [] head= {"goodId","goodName","num","price"}; DefaultTableModel model=new DefaultTableModel(data,head); /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { first frame = new first(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public first() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 853, 519); contentPane = new JPanel(); setContentPane(contentPane); contentPane.setLayout(new BorderLayout(0, 0)); JPanel panel = new JPanel(); contentPane.add(panel, BorderLayout.NORTH); panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); JLabel lblNewLabel = new JLabel("商品名稱"); panel.add(lblNewLabel); textField = new JTextField(); panel.add(textField); textField.setColumns(10); JButton btnNewButton = new JButton("查詢"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SqlTest sqlTest=new SqlTest(); try { ArrayList shopss panel.add(btnNewButton); JButton btnNewButton_2 = new JButton("添加"); panel.add(btnNewButton_2); JScrollPane scrollPane = new JScrollPane(); contentPane.add(scrollPane, BorderLayout.CENTER); table = new JTable(model); scrollPane.setViewportView(table); JButton btnNewButton_1 = new JButton("刪除"); btnNewButton_1.setVerticalAlignment(SwingConstants.TOP); contentPane.add(btnNewButton_1, BorderLayout.EAST); btnNewButton_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int num=table.getSelectedRow(); int id= (int) table.getValueAt(num, 0); SqlTest sqlTest=new SqlTest(); try { sqlTest.delete_shop(id); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { ArrayList shopss= sqlTest.query(); Object[][] shop_query=new Object[shopss.size()][4]; for (int i = 0; i < shop_query.length; i++) { shop_query[i][0]=shopss.get(i).getGoodId(); shop_query[i][1]=shopss.get(i).getGoodName(); shop_query[i][2]=shopss.get(i).getNum(); shop_query[i][3]=shopss.get(i).getPrice(); } data=shop_query; model.setDataVector(data, head); } catch (SQLException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } } }); btnNewButton_2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { three three=new three(first.this); three.setVisible(true); } }); } }

第一的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
合水县| 湘阴县| 婺源县| 红原县| 峡江县| 安康市| 织金县| 勐海县| 尼木县| 黄陵县| 碌曲县| 乌兰县| 呼玛县| 舞阳县| 靖安县| 轮台县| 汉中市| 普定县| 电白县| 张家港市| 加查县| 清镇市| 岳阳市| 宜阳县| 浪卡子县| 金沙县| 神池县| 宁波市| 庄浪县| 古丈县| 通化市| 香格里拉县| 青川县| 鹤壁市| 北川| 乐业县| 奈曼旗| 田阳县| 桦甸市| 武汉市| 格尔木市|