/*
* 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();
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.
*/
}
/**
* Set the size of the panel
* @return an instance of Dimension that represents the preferred size of this container.
*/
}
/**
* Proceed the execution of the action
* @return the result of the request.
* @param unUsed Not used
* @throws Exception if the command is not executed.
*/
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 JLabel rowLengthLabel
;
}