Package vista

Source Code of vista.AltaServicio

package vista;

import java.awt.Color;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import javax.swing.border.SoftBevelBorder;
import javax.swing.border.TitledBorder;





public class AltaServicio extends FormularioServicio {

  private static final long serialVersionUID = 1L;
 
 
  public AltaServicio(AbmServicio a) {
    super(a);
    configurarBotonAceptar();
    configurarBotonCancelar();
    getPanelFormulario().setBorder(BorderFactory.createTitledBorder(new SoftBevelBorder(SoftBevelBorder.RAISED), "Alta Servicio", TitledBorder.LEFT, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 14), Color.black));
  }

  protected void configurarBotonAceptar() {
    getBotonAceptar().addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent e) {
        if (getTextoNombre().getText().equals(null)|| getTextoCostoMinimo().getText().equals(null)
          ||getTextoTiempoEjecucion().getText().equals(null)) {
          JOptionPane.showMessageDialog(null, "Falta rellenar campos");
           
          }else{
          getServicio().setNombre(getTextoNombre().getText());
          getServicio().setDescripcion(getTextoDescripcion().getText());
          String costoMinimo = getTextoCostoMinimo().getText();
          getServicio().setCostoMinimo(pasarBigDecimal(costoMinimo));
          getServicio().setTiempoEjecucion(getTextoTiempoEjecucion().getText());
                 
         
          getAbm().termino();
          }
        }
      });
    }
 

  protected void configurarBotonCancelar() {
    getBotonCancelar().addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent e) {
        getAbm().termino();
      }
    });
  }

}
TOP

Related Classes of vista.AltaServicio

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.