📄 frame2.java~1~
字号:
package kucunguanli;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.util.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Frame2 extends JFrame { JLabel jLabel1 = new JLabel(); JTextField jTextField1 = new JTextField(); JLabel jLabel2 = new JLabel(); JTextField jTextField2 = new JTextField(); JLabel jLabel3 = new JLabel(); JTextField jTextField3 = new JTextField(); JLabel jLabel4 = new JLabel(); JTextField jTextField4 = new JTextField(); JLabel jLabel5 = new JLabel(); JTextField jTextField5 = new JTextField(); JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); public Frame2() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { jLabel1.setFont(new java.awt.Font("Dialog", 0, 18)); jLabel1.setToolTipText(""); jLabel1.setText("产品名称"); jLabel1.setBounds(new Rectangle(51, 26, 75, 29)); this.setTitle("库存信息的录入"); this.getContentPane().setLayout(null); jTextField1.setText("jTextField1"); jTextField1.setBounds(new Rectangle(149, 26, 121, 25)); jLabel2.setFont(new java.awt.Font("Dialog", 0, 18)); jLabel2.setText("产品类型"); jLabel2.setBounds(new Rectangle(49, 69, 81, 26)); jTextField2.setText("jTextField2"); jTextField2.setBounds(new Rectangle(147, 68, 124, 24)); jLabel3.setFont(new java.awt.Font("Dialog", 0, 18)); jLabel3.setText("产品价格"); jLabel3.setBounds(new Rectangle(50, 110, 74, 30)); jTextField3.setText("jTextField3"); jTextField3.setBounds(new Rectangle(146, 109, 126, 26)); jLabel4.setFont(new java.awt.Font("Dialog", 0, 18)); jLabel4.setText("仓库代号"); jLabel4.setBounds(new Rectangle(51, 154, 74, 30)); jTextField4.setText("jTextField4"); jTextField4.setBounds(new Rectangle(145, 154, 125, 26)); jLabel5.setFont(new java.awt.Font("Dialog", 0, 18)); jLabel5.setText("产品编号"); jLabel5.setBounds(new Rectangle(48, 202, 72, 31)); jTextField5.setText("jTextField5"); jTextField5.setBounds(new Rectangle(143, 202, 129, 28)); jButton1.setBounds(new Rectangle(68, 273, 78, 32)); jButton1.setBorder(BorderFactory.createLineBorder(Color.black)); jButton1.setDebugGraphicsOptions(DebugGraphics.FLASH_OPTION); jButton1.setHorizontalAlignment(SwingConstants.CENTER); jButton1.setText("录入"); jButton1.addActionListener(new Frame2_jButton1_actionAdapter(this)); jButton2.setBounds(new Rectangle(219, 270, 90, 33)); jButton2.setBorder(BorderFactory.createLineBorder(Color.black)); jButton2.setText("退出"); jButton2.addActionListener(new Frame2_jButton2_actionAdapter(this)); this.getContentPane().add(jLabel1, null); this.getContentPane().add(jTextField1, null); this.getContentPane().add(jLabel2, null); this.getContentPane().add(jTextField2, null); this.getContentPane().add(jLabel3, null); this.getContentPane().add(jTextField3, null); this.getContentPane().add(jLabel4, null); this.getContentPane().add(jTextField4, null); this.getContentPane().add(jLabel5, null); this.getContentPane().add(jTextField5, null); this.getContentPane().add(jButton1, null); this.getContentPane().add(jButton2, null); } void jButton2_actionPerformed(ActionEvent e) { System.exit(0); } void jButton1_actionPerformed(ActionEvent e) { Hashtable number=new Hashtable(); number.put("产品名称",new Integer(1)); number.put("产品类型",new Integer(2)); }}class Frame2_jButton2_actionAdapter implements java.awt.event.ActionListener { Frame2 adaptee; Frame2_jButton2_actionAdapter(Frame2 adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton2_actionPerformed(e); }}class Frame2_jButton1_actionAdapter implements java.awt.event.ActionListener { Frame2 adaptee; Frame2_jButton1_actionAdapter(Frame2 adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -