admin 管理员组文章数量: 1086019
2024年1月13日发(作者:java中public的用法)
public void run() { try { MainFrame frame = new MainFrame(); ible(true); } catch (Exception e) { tackTrace(); } } }); } /** * Create the frame. */ public MainFrame() {
//改变系统默认字体 Font font = new Font("Dialog", , 12); ation
setTitle("u56FEu4E66u7BA1u7406u7CFBu7EDFu4E3Bu754Cu9762"); setDefaultCloseOperation(_ON_CLOSE); setBounds(100, 100, 450, 300);
JMenuBar menuBar = new JMenuBar(); lTipText(""); setJMenuBar(menuBar);
JMenu menu = new JMenu("u57FAu672Cu6570u636Eu7EF4u62A4 "); n(new ImageIcon(ource("/images/"))); (menu);
JMenu mnNewMenu = new JMenu("u56FEu4E66u7C7Bu522Bu7BA1u7406 "); n(new ImageIcon(ource("/images/"))); (mnNewMenu);
//图书类别添加 JMenuItem menuItem = new JMenuItem("u56FEu4E66u7C7Bu522Bu6DFBu52A0"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { BookTypeAddInterFrame bookTypeAddInterFrame=new BookTypeAddInterFrame(); ible(true); (bookTypeAddInterFrame); } }); n(new ImageIcon(ource("/images/"))); (menuItem);
//图书类别维护 JMenuItem menuItem_1 = new JMenuItem("u56FEu4E66u7C7Bu522Bu7EF4u62A4"); menuItem_ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { BookTypeManageInterFrame bookTypeManageInterFrame=new BookTypeManageInterFrame(); ible(true); (bookTypeManageInterFrame); } }); menuItem_n(new ImageIcon(ource("/images/")));
} catch (Exception e) { tackTrace(); } } }); } /** * Create the frame. */ public BookTypeManageInterFrame() {
//改变系统默认字体 Font font = new Font("Dialog", , 12); ation keys = aults().keys(); while (eElements()) { Object key = ement(); Object value = (key); if (value instanceof Resource) { (key, font); } } setIconifiable(true); setClosable(true); setTitle("图书类别管理"); setBounds(400, 100, 535, 489);
JScrollPane scrollPane = new JScrollPane();
JLabel label = new JLabel("图书类别名称:");
s_bookTypeNameText = new JTextField(); s_umns(10);
//查询按钮 JButton searchBtn = new JButton("查询"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { searchActionPerformed(e); } }); n(new ImageIcon(ource("/images/")));
JPanel panel = new JPanel(); der(new TitledBorder(null, "u8868u5355u64CDu4F5C", G, , null, null)); GroupLayout groupLayout = new GroupLayout(getContentPane()); izontalGroup( ParallelGroup(G) .addGroup(SequentialGroup() .addGap(56) .addComponent(label) .addPreferredGap(TED) .addComponent(s_bookTypeNameText, RED_SIZE, 167, RED_SIZE) .addPreferredGap(D, 54, _VALUE) .addComponent(searchBtn) .addGap(71)) .addGroup(SequentialGroup() .addGap(36) .addGroup(ParallelGroup(NG, false) .addComponent(panel, G, T_SIZE, T_SIZE, _VALUE) .addComponent(scrollPane, G)) .addContainerGap(31, _VALUE)) ); ticalGroup( ParallelGroup(G) .addGroup(SequentialGroup()
.addGroup(SequentialGroup() .addGap(27) .addGroup(ParallelGroup(NE) .addComponent(searchBtn) .addComponent(label) .addComponent(s_bookTypeNameText, RED_SIZE, T_SIZE, RED_SIZE)) .addGap(18) .addComponent(scrollPane, RED_SIZE, 167, RED_SIZE) .addGap(18) .addComponent(panel, T_SIZE, 194, _VALUE) .addContainerGap()) );
JLabel label_1 = new JLabel("编号:");
idText = new JTextField(); table(false); umns(10);
JLabel label_2 = new JLabel("图书类别名称:");
bookTypeNameText = new JTextField(); umns(10);
JLabel label_3 = new JLabel("描述:");
bookTypeDescText = new JTextArea();
//修改按钮 JButton modifyBtn = new JButton("修改"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { bookTypeUpdateActionPerformed(e); } }); n(new ImageIcon(ource("/images/")));
//删除按钮 JButton deleteBtn = new JButton("删除"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { bookTypeDeleteActionPerformed(e); } }); n(new ImageIcon(ource("/images/"))); GroupLayout gl_panel = new GroupLayout(panel); gl_izontalGroup( gl_ParallelGroup(G) .addGroup(gl_SequentialGroup() .addGap(19) .addGroup(gl_ParallelGroup(NG) .addGroup(G, gl_SequentialGroup() .addComponent(label_1) .addPreferredGap(D) .addComponent(idText, RED_SIZE, 47, RED_SIZE) .addGap(18) .addComponent(label_2) .addPreferredGap(TED) .addComponent(bookTypeNameText, RED_SIZE, 166, RED_SIZE)) .addGroup(G, gl_SequentialGroup() .addComponent(label_3) .addPreferredGap(D) .addComponent(bookTypeDescText)) .addGroup(gl_SequentialGroup() .addComponent(modifyBtn) .addGap(54)
private JButton resetBtn; //添加按钮 private JButton addBtn; //图书类别数据库访问对象 private BookTypeDao bookTypeDao; /** * Launch the application. */ public static void main(String[] args) { Later(new Runnable() { public void run() { try { BookTypeAddInterFrame frame = new BookTypeAddInterFrame(); ible(true); } catch (Exception e) { tackTrace(); } } }); } /** * Create the frame. */ public BookTypeAddInterFrame() { //改变系统默认字体 Font font = new Font("Dialog", , 12); ation keys = aults().keys(); while (eElements()) { Object key = ement(); Object value = (key); if (value instanceof Resource) { (key, font); } } setClosable(true); setIconifiable(true); setTitle("图书类别添加"); setBounds(100, 100, 487, 342);
JLabel label = new JLabel("图书类别名称:");
bookTypeNameText = new JTextField(); umns(10);
JLabel label_1 = new JLabel("图书类别描述:");
bookTypeDescText = new JTextArea();
//添加按钮 addBtn = new JButton("添加"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addActionPerformed(e); } }); //重置按钮 resetBtn = new JButton("重置"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { resetActionPerformed(e); } }); GroupLayout groupLayout = new GroupLayout(getContentPane()); izontalGroup( ParallelGroup(G)
import Listener;import Event;import dapter;import vent;public class BookManageInterFrame extends JInternalFrame { private JTextField s_bookNameText; private JTextField s_authorText; private JTable bookTable; private JComboBox s_bookTypecomboBox; private BookTypeDao bookTypeDao; private BookDao bookDao; private JTextField idText; private JTextField bookNameText; private JTextField priceText; private JTextField authorText; private JTextField bookDescText; private final ButtonGroup buttonGroup = new ButtonGroup(); private JComboBox bookTypeComboBox; private JRadioButton maleBtn; private JRadioButton femaleBtn; /** * Launch the application. */ public static void main(String[] args) { Later(new Runnable() { public void run() { try { BookManageInterFrame frame = new BookManageInterFrame(); ible(true); } catch (Exception e) { tackTrace(); } } }); } /** * Create the frame. */ public BookManageInterFrame() {
//改变系统默认字体 Font font = new Font("Dialog", , 12); ation keys = aults().keys(); while (eElements()) { Object key = ement(); Object value = (key); if (value instanceof Resource) { (key, font); } }
setIconifiable(true); setClosable(true); setTitle("图书管理 "); setBounds(100, 100, 767, 528);
JPanel panel = new JPanel(); der(new TitledBorder(null, "搜索条件", G, , null, null));
JScrollPane scrollPane = new JScrollPane();
JPanel panel_1 = new JPanel(); panel_der(new TitledBorder(null, "表单操作", G, , null, null)); GroupLayout groupLayout = new GroupLayout(getContentPane());
} }); n(new ImageIcon(ource("/images/")));
//删除按钮 JButton deleteBtn = new JButton("删除"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { deleteBookActionPerformed(e); } }); n(new ImageIcon(ource("/images/"))); GroupLayout gl_panel_1 = new GroupLayout(panel_1); gl_panel_izontalGroup( gl_panel_ParallelGroup(NG) .addGroup(gl_panel_SequentialGroup() .addGap(44) .addGroup(gl_panel_ParallelGroup(G, false) .addGroup(gl_panel_SequentialGroup() .addComponent(label_8) .addPreferredGap(D) .addComponent(bookDescText)) .addGroup(gl_panel_SequentialGroup() .addGroup(gl_panel_ParallelGroup(NG) .addComponent(label_2) .addComponent(label_5)) .addPreferredGap(TED) .addGroup(gl_panel_ParallelGroup(G, false) .addComponent(priceText) .addComponent(idText, T_SIZE, 86, _VALUE)) .addGap(37) .addGroup(gl_panel_ParallelGroup(G, false) .addGroup(gl_panel_SequentialGroup() .addComponent(label_3) .addPreferredGap(D) .addComponent(bookNameText, RED_SIZE, 136, RED_SIZE)) .addGroup(gl_panel_SequentialGroup() .addComponent(label_6) .addPreferredGap(D) .addComponent(authorText))) .addGap(35) .addGroup(gl_panel_ParallelGroup(G) .addGroup(gl_panel_SequentialGroup() .addComponent(label_4) .addPreferredGap(TED) .addComponent(maleBtn) .addGap(18) .addComponent(femaleBtn)) .addGroup(gl_panel_SequentialGroup() .addComponent(label_7) .addPreferredGap(TED) .addComponent(bookTypeComboBox, RED_SIZE, 97, RED_SIZE))))) .addContainerGap(34, _VALUE)) .addGroup(gl_panel_SequentialGroup() .addContainerGap(201, _VALUE) .addComponent(modifyBtn) .addGap(104) .addComponent(deleteBtn) .addGap(190)) ); gl_panel_ticalGroup( gl_panel_ParallelGroup(G) .addGroup(gl_panel_SequentialGroup() .addContainerGap() .addGroup(gl_panel_ParallelGroup(NE) .addComponent(maleBtn)
}); n(new ImageIcon(ource("/images/"))); // 图书重置按钮 JButton resetBtn = new JButton("重置"); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { bookResetActionPerformed(e); } }); n(new ImageIcon(ource("/images/"))); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout .setHorizontalGroup(ParallelGroup(G) .addGroup(SequentialGroup().addGap(38).addGroup(groupLayout .createParallelGroup( G) .addGroup( SequentialGroup().addGap(6).addGroup(groupLayout .createParallelGroup(G, false) .addGroup(SequentialGroup().addGroup(groupLayout .createParallelGroup(G, false) .addGroup(SequentialGroup() .addComponent(label_4).addPreferredGap( D) .addComponent(bookTypeComboBox, 0, T_SIZE, _VALUE)) .addGroup(SequentialGroup() .addComponent(label) .addPreferredGap(D) .addComponent(bookNameText, RED_SIZE, 116, RED_SIZE)) .addGroup(SequentialGroup() .addComponent(label_2) .addPreferredGap(D) .addComponent(maleBtn) .addPreferredGap(TED) .addComponent(femaleBtn))) .addGap(44) .addGroup(groupLayout .createParallelGroup(G, false) .addGroup(SequentialGroup() .addComponent(label_3) .addPreferredGap(TED) .addComponent(priceText)) .addGroup(SequentialGroup() .addComponent(label_1) .addPreferredGap(D) .addComponent(authorText, RED_SIZE, 128, RED_SIZE)))) .addGroup(SequentialGroup().addComponent(label_5) .addPreferredGap(D) .addComponent(bookDescText))) .addPreferredGap(D, 164, _VALUE)) .addGroup(SequentialGroup().addGap(94).addComponent(addBtn).addGap(96) .addComponent(resetBtn))) .addContainerGap())); ticalGroup(ParallelGroup(G) .addGroup(SequentialGroup().addGap(32) .addGroup(ParallelGroup(NE).addComponent(label) .addComponent(bookNameText, RED_SIZE, T_SIZE, RED_SIZE) .addComponent(label_1).addComponent(authorText, RED_SIZE, T_SIZE, RED_SIZE)) .addGap(31)
版权声明:本文标题:基于Javaswing+mysql+eclipse的【图书管理系统】 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1705081190a472449.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论