⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createpanel.java

📁 This project developed in java leads us to realize a flight reservation system in order to emulate d
💻 JAVA
字号:
/* * CreatePanel.java * The package panels contains the different class executing the different windows of each function of the FlightSystem Reservation. */package reservation.system.panels;import reservation.system.functions.Create;import javax.swing.*;import java.awt.Dimension;/** * This class hold Create structure. This object allows to create a new flight in the data base by calling the method <CODE>create</CODE> in {@link reservation.system.FlightSystem}. * It use a GUI that contains a form with the several field to fill. * @author Texier Mathieu and Frederic Bidon */public class CreatePanel extends Panels {        /** Creates new form CreatePanel */    public CreatePanel () {        action = new Create();                rowsInput = new JTextField();        nameLabel = new JLabel();        rowsLabel = new JLabel();        rowLengthInput = new JTextField();        nameInput = new JTextField();        rowLengthLabel = new JLabel();        nameLabel.setText("Name");        add(nameLabel);        add(nameInput);         rowLengthLabel.setText("Row Length");        add(rowLengthLabel);        add(rowLengthInput);        rowsLabel.setText("Rows");        add(rowsLabel);        add(rowsInput);        }    /**   * Causes this container to lay out its components.    */    public void doLayout () {        nameLabel.setBounds(20, 10, 100, 20);        nameInput.setBounds(170, 10, 100, 20);        rowLengthLabel.setBounds(20, 40, 100, 20);        rowLengthInput.setBounds(170, 40, 100, 20);        rowsLabel.setBounds(20, 70, 100, 20);        rowsInput.setBounds(170, 70, 100, 20);    }           /**     * Set the size of the panel     * @return an instance of Dimension that represents the minimum size of this container.     */    public Dimension getMinimumSize () {        return new Dimension(300,100);    }      /**     * Set the size of the panel     * @return an instance of Dimension that represents the preferred size of this container.     */    public Dimension getPreferredSize () {        return new Dimension(300,100);    }       /**     * Proceed the execution of the action     * @return the result of the request.     * @param unUsed Not used     * @throws Exception if the command is not executed.     */     public String execute (String[] unUsed) throws Exception {        String arg[] = {nameInput.getText(), rowsInput.getText(), rowLengthInput.getText()};        return action.execute(arg);    }        /**     * Initialize the number of the field and fill them with default values.     * Dispaly the label of the Window.     */    public void init () {    }        private JTextField nameInput;    private JLabel nameLabel;    private JTextField rowLengthInput;    private JLabel rowLengthLabel;    private JTextField rowsInput;    private JLabel rowsLabel;  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -