📄 addfoodframe.java
字号:
/*
* AddFoodFrame1.java
*
* Created on 2007年6月18日, 上午1:07
*/
package frames;
import javax.swing.JOptionPane;
import module.Resource;
import java.util.*;
import javax.swing.*;
import java.lang.*;
import plugin.*;
import module.*;
import helper.*;
import dennis.*;
/**
*
* @author Administrator
*/
public class AddFoodFrame extends javax.swing.JInternalFrame {
public String name;
public String type;
public String foodunit;
/** Creates new form AddFoodFrame1 */
public AddFoodFrame() {
initComponents();
this.setTitle("Add Food");
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
nameLabel = new javax.swing.JLabel();
foodNameText = new javax.swing.JTextField();
typeLabel = new javax.swing.JLabel();
foodType = new javax.swing.JComboBox();
unitLabel = new javax.swing.JLabel();
unitText = new javax.swing.JTextField();
priceLabel = new javax.swing.JLabel();
priceText = new javax.swing.JTextField();
addFood = new javax.swing.JButton();
foodIdLabel = new javax.swing.JLabel();
foodIdText = new javax.swing.JTextField();
jPanel2 = new javax.swing.JPanel();
foodNumLabel2 = new javax.swing.JLabel();
nameText1 = new javax.swing.JTextField();
query = new javax.swing.JButton();
priceLabel1 = new javax.swing.JLabel();
storeLabel = new javax.swing.JLabel();
priceText1 = new javax.swing.JTextField();
store = new javax.swing.JComboBox();
modifition = new javax.swing.JButton();
reset = new javax.swing.JButton();
delFood = new javax.swing.JButton();
setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setEnabled(false);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("\u6dfb\u52a0\u98df\u7269"));
nameLabel.setText("\u540d\u79f0\uff1a");
typeLabel.setText("\u7c7b\u578b\uff1a");
foodType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "\u83dc\u7c7b", "\u751c\u70b9", "\u996e\u6599", "\u540d\u9152", "\u540d\u8336", "\u70df\u7c7b" }));
unitLabel.setText("\u5355\u4f4d\uff1a");
priceLabel.setText("\u5355\u4ef7\uff1a");
addFood.setText("\u6dfb\u52a0");
addFood.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addFoodActionPerformed(evt);
}
});
foodIdLabel.setText("\u7f16\u53f7\uff1a");
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(priceLabel)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(priceText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE))
.add(jPanel1Layout.createSequentialGroup()
.add(unitLabel)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(unitText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE))
.add(jPanel1Layout.createSequentialGroup()
.add(nameLabel)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(foodNameText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)))
.add(55, 55, 55))
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.add(foodIdLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(foodIdText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
.add(15, 15, 15)
.add(typeLabel)
.add(4, 4, 4)))
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(addFood, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(foodType, 0, 86, Short.MAX_VALUE))
.add(32, 32, 32))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(31, 31, 31)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(nameLabel)
.add(foodNameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(typeLabel)
.add(foodIdText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(foodIdLabel)
.add(foodType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(23, 23, 23)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(unitText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(unitLabel))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(priceLabel)
.add(priceText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(addFood))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("\u4fee\u6539\u98df\u7269\u4fe1\u606f"));
foodNumLabel2.setText("\u7f16\u53f7\uff1a");
query.setText("\u67e5\u8be2");
query.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
queryActionPerformed(evt);
}
});
priceLabel1.setText("\u5355\u4ef7\uff1a");
storeLabel.setText("\u5e93\u5b58\u60c5\u51b5\uff1a");
store.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "\u6709", "\u65e0" }));
modifition.setText("\u4fee\u6539");
modifition.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
modifitionActionPerformed(evt);
}
});
reset.setText("\u91cd\u7f6e");
reset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
resetActionPerformed(evt);
}
});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -