Cafeteria java topicos

Solo disponible en BuenasTareas
  • Páginas : 2 (386 palabras )
  • Descarga(s) : 0
  • Publicado : 19 de agosto de 2012
Leer documento completo
Vista previa del texto
package UnidadIII;



import java.awt.BorderLayout;

import java.awt.Color;

import java.awt.Container;

import java.awt.Font;

import java.awt.GridLayout;

importjava.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JComboBox;

import javax.swing.JFrame;

import javax.swing.JLabel;

importjavax.swing.JPanel;

import javax.swing.JSplitPane;

import javax.swing.JTextField;





public class Cafeteria extends JFrame implements ActionListener {//ItemListener

Container contenedor;public String[] comida=new String[]{"Alimentos","Hamburguesas","Sandwich","Torta","Tacos"};

public String[] bebida=new String[]{"Bebidas","Refresco","Limonada","Te","Agua"};

publicString[] postre=new String[]{"Postres","Heladode vainilla","Helado de nuez","Chocoflan"};

public JComboBox cmbcomidas;

public JComboBox cmbbebidas;

public JComboBox cmbpostres;JSplitPane splitpanel;

JPanel panelsup,panelinf;

JButton generaOrden,salir;

JTextField txtnombre;

JLabel lblnombre;

JLabel lblorden,lbltotal;



publicCafeteria(){

super("El buen Comer: ");

contenedor=this.getContentPane();

splitpanel=new JSplitPane(JSplitPane.VERTICAL_SPLIT);

panelsup=new JPanel();



panelinf=newJPanel();



panelsup.setLayout(new GridLayout(3,2));

panelinf.setLayout(new BorderLayout());

panelinf.setBackground(Color.BLUE);



cmbcomidas=new JComboBox(comida);cmbbebidas=new JComboBox(bebida);

cmbpostres=new JComboBox(postre);

generaOrden=new JButton("Generar Orden");

salir=new JButton("Salir");

txtnombre=new JTextField(30);lblnombre=new JLabel("Nombre del Cliente");

lblorden=new JLabel();

lblorden.setFont(new Font("Sherif",Font.BOLD,16));

lbltotal=new JLabel();

lbltotal.setFont(new...
tracking img