Global Class
package Libs;
/**
*
* @author Hancie Phago
*/
public class Global2 {
public static final String ROOM_TYPES[]= {"Single","Double","Deluxe"};
public static final double ROOM_PRICE[]= {1000,2000,3000};
}
package Trial;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import com.toedter.calendar.JDateChooser;
import Libs.Global;
import Libs.Global2;
import regularExpression.RegexExpression;
public class Demo {
JTextField ratetxt;
JComboBox typecombo;
JDateChooser DOBtxt;
JButton register;
public Demo() {
JFrame frame = new JFrame("Hancie e-Learning Studio");
frame.setSize(550, 400);
frame.setLayout(new BorderLayout());
JPanel main = new JPanel();
main.setLayout(null);
frame.add(main,BorderLayout.CENTER);
typecombo = new JComboBox();
for (int i = 0; i < Global2.ROOM_TYPES.length; i++) {
typecombo.addItem(Global2.ROOM_TYPES[i]);
}
typecombo.setFont(new Font("Tahoma", Font.PLAIN, 17));
typecombo.setBounds(130, 150, 220, 35);
main.add(typecombo);
frame.setVisible(true);
}
public static void main(String[] args) {
new Demo();
}
}