1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
package gesdep;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import jdatechooser.JCalendar;
import jdatechooser.JDateChooser;
public class Interfaz extends JDialog {
private JMenuBar b;
private JMenu fichero;
private JMenu edicion;
private JMenu visualizacion;
private JMenu ayuda;
private JPanel p1;
private JPanel p2;
private JPanel p3;
private JScrollPane sp1;
private JScrollPane sp2;
private JComboBox l0;
private JComboBox l1;
private JComboBox l2;
private JComboBox l3;
private JFrame principal;
private JTextArea ta;
private JButton b1;
private JButton b2;
private JDateChooser c1;
private JDateChooser c2;
private JDateChooser c3;
private JTextField t1;
private JTextField t2;
private JTextField t3;
private JTextField t4;
private JTextField t5;
private JTextField t6;
private JLabel lab1;
private JLabel lab2;
private JLabel lab3;
private JLabel lab4;
private JLabel lab5;
private JLabel lab6;
public Interfaz() {
super ();
b = new JMenuBar();
fichero = new JMenu("Fichero");
edicion = new JMenu ("Edicion");
visualizacion = new JMenu ("Visualizacion");
ayuda = new JMenu ("Ayuda");
b.setPreferredSize(new Dimension (1000,40));
b.add(fichero);
b.add(edicion);
b.add(visualizacion);
b.add(ayuda);
this.setJMenuBar(b);
b1 = new JButton ("Reservar");
b2 = new JButton ("Reservar");
t1 = new JTextField(8);
t2 = new JTextField(8);
t3 = new JTextField(8);
t4 = new JTextField(8);
t5 = new JTextField(8);
t6 = new JTextField(8);
lab1 = new JLabel ("Hora de inicio");
lab2 = new JLabel ("Hora de fin");
lab3 = new JLabel ("Fecha de inicio");
lab4 = new JLabel ("Fecha de fin");
lab5 = new JLabel ("Fecha");
lab6 = new JLabel ("Numero de equipos");
String [] deportes;
deportes = new String []{"Tenis", "Futbol", "Rugby", "Badminton", "Voleibol"};
l0 = new JComboBox (deportes);
l1 = new JComboBox (deportes);
String [] campeonatos;
campeonatos = new String []{"Liga", "Torneo", "Eliminatorio"};
l2 = new JComboBox (campeonatos);
String [] centros;
centros = new String []{"Madrid 1", "Madrid 2", "Madrid 3", "Aranjuez", "Alcala de henares", "Miraflores"};
l3 = new JComboBox (centros);
ta = new JTextArea ();
c1 = new JDateChooser ();
c2 = new JDateChooser ();
c3 = new JDateChooser ();
FlowLayout experimentLayout1 = new FlowLayout();
p1 = new JPanel (new BorderLayout()) ;
p1.setBorder(new TitledBorder("Reservar evento" ));
p1.setBackground(Color.gray);
p1.setLayout(experimentLayout1);
p1.add(lab5);
p1.add(t5);
p1.add(c1);
p1.add(lab1);
p1.add(t1);
p1.add(lab2);
p1.add(t2);
p1.add(l0);
p1.add(b1);
p1.setPreferredSize(new Dimension(1000, 250));
p2 = new JPanel (new BorderLayout()) ;
p2.setBorder(new TitledBorder("Reservar campeonato" ));
p2.setBackground(Color.gray);
p2.setLayout(experimentLayout1);
p2.add(lab3);
p2.add(t3);
p2.add(c2);
p2.add(lab4);
p2.add(t4);
p2.add(c3);
p2.add(lab6);
p2.add(t6);
p2.add(l1);
p2.add(l2);
p2.add(l3);
p2.add(b2);
p2.setPreferredSize(new Dimension(1000, 250));
p3 = new JPanel (new BorderLayout()) ;
p3.setBorder(new TitledBorder("Visualizacion" ));
p3.setBackground(Color.white);
p3.setLayout(experimentLayout1);
p3.add(ta);
p3.setPreferredSize(new Dimension(1000, 200));
principal = new JFrame ("GED:Gestor de eventos deportivos");
principal.setSize(1000,800);
principal.setJMenuBar(b);
principal.getContentPane().add(p1, "North");
principal.getContentPane().add(p2, "Center");
principal.getContentPane().add(p3, "South");
principal.setVisible(true);
}
public static void main (String [] arg ){
Interfaz mainWindow = new Interfaz();
}
} |
Partager