国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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ó)家法律
开远市| 平凉市| 尼勒克县| 绥德县| 龙江县| 闻喜县| 株洲市| 兴义市| 肇庆市| 英德市| 乡城县| 宾川县| 武功县| 陇南市| 额尔古纳市| 龙井市| 安庆市| 玛纳斯县| 二连浩特市| 绵竹市| 浦北县| 卓尼县| 翼城县| 修水县| 磴口县| 北宁市| 千阳县| 彭山县| 胶州市| 独山县| 山丹县| 兴义市| 康乐县| 洛扎县| 治县。| 阿拉善右旗| 汝城县| 绥中县| 龙里县| 鄂州市| 塔河县|