/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* FrmVisualizarGrupoCarro.java
*
* Created on 09/10/2010, 21:55:32
*/
package boundary;
import domain.GrupoCarro;
import java.text.DecimalFormat;
import java.util.Vector;
/**
*
* @author Rodrigo Martins
*/
public class FrmVisualizarGrupoCarro extends javax.swing.JDialog {
/** Creates new form FrmVisualizarGrupoCarro */
public FrmVisualizarGrupoCarro(java.awt.Frame parent, boolean modal, Vector grupo) {
initComponents();
this.setModal(true);
this.setLocationRelativeTo(null);
preencherCampos(grupo);
}
private void preencherCampos(Vector grupo) {
DecimalFormat decimalFormat = new DecimalFormat("#.00");
String valorFormatado;
double valor = 0;
this.jLNomeGC.setText(grupo.get(0).toString());
valor = Double.parseDouble(grupo.get(1).toString());
valorFormatado = decimalFormat.format(valor);
this.jLPD.setText(valorFormatado);
valor = Double.parseDouble(grupo.get(2).toString());
valorFormatado = decimalFormat.format(valor);
this.jLPDQ.setText(valorFormatado);
valor = Double.parseDouble(grupo.get(3).toString());
valorFormatado = decimalFormat.format(valor);
this.jLPDC.setText(valorFormatado);
// this.jLNomeGC.setText(grupo.get(0).toString());
// this.jLPD.setText(grupo.get(1).toString());
// this.jLPDQ.setText(grupo.get(2).toString());
// this.jLPDC.setText(grupo.get(3).toString());
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLNomeGC = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLPD = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLPDQ = new javax.swing.JLabel();
jLPDC = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Vizualizar Grupo Carro");
jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jLabel1.setText("Nome do Grupo de Carro:");
jLNomeGC.setFont(new java.awt.Font("Tahoma", 1, 11));
jLNomeGC.setForeground(new java.awt.Color(255, 0, 0));
jLNomeGC.setText("nome");
jLabel3.setText("Preço Diaria:");
jLabel4.setText("R$");
jLPD.setForeground(new java.awt.Color(255, 0, 0));
jLPD.setText("valor");
jLabel6.setText("Preço Diaria Quilomentrada:");
jLabel7.setText("R$");
jLPDQ.setForeground(new java.awt.Color(255, 0, 0));
jLPDQ.setText("valor");
jLPDC.setForeground(new java.awt.Color(255, 0, 0));
jLPDC.setText("valor");
jLabel10.setText("R$");
jLabel11.setText("Preço Diaria Cobertura:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(29, 29, 29)
.addComponent(jLNomeGC))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLPD))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLPDQ))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLPDC)))
.addContainerGap(181, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLNomeGC))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLPD))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLPDQ))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(jLabel10)
.addComponent(jLPDC))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jButton1.setText("Sair");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton1)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(20, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @param args the command line arguments
// */
// public static void main(String args[]) {
// java.awt.EventQueue.invokeLater(new Runnable() {
// public void run() {
// new FrmVisualizarGrupoCarro().setVisible(true);
// }
// });
// }
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLNomeGC;
private javax.swing.JLabel jLPD;
private javax.swing.JLabel jLPDC;
private javax.swing.JLabel jLPDQ;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
// End of variables declaration//GEN-END:variables
}