NetBeans - ex7_betao

paltryboarpigΛογισμικό & κατασκευή λογ/κού

3 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

98 εμφανίσεις





NetBeans
-

ex7_betao



* Created on 6/Jul/2010, 11:57:34

package ex7_betao


* @author Margarida


*/

public class ex7_betao extends javax.swing.JApplet {


/** Initializes the applet ex7_betao */


public void init() {


try {


java.awt.EventQueue.invokeAndWait(new Runnable() {


public void run() {






initComponents();


}


});



} catch (Exception ex) {


ex.printStackTrace();


}


}



/** This method is called from within the init() method 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">


private void initComponents() {



jLabel1 = new javax.swing.JLabel();


jLabel2 = new javax.swing.JLabel();


jLabel3 = new javax.swing.JLabel();


jLabel5 = new javax.swing.JLabel();


alt = new javax.swing.JTextField();


larg = new javax.swing.JTextField();


comp = new javax.swing.JTe
xtField();


jRadioButton1 = new javax.swing.JRadioButton();


jRadioButton2 = new javax.swing.JRadioButton();


jRadioButton3 = new javax.swing.JRadioButton();






jRadioButton4 = new javax.swing.JRadioButton();


jRadioButton5 = new javax.swing.JRadioButton();


jRadioButton6 = new javax.swing.JRadioButton();


jRadioButton7 = new javax.swing.JRadioButton();


jButton1 = new javax.swing.JButton();


tot_betao = new javax.swing.JTextF
ield();


jButton3 = new javax.swing.JButton();


tot = new javax.swing.JTextField();


jLabel4 = new javax.swing.JLabel();


jLabel6 = new javax.swing.JLabel();


jLabel7 = new javax.swing.JLabel();


jLabel8 = new
javax.swing.JLabel();


jLabel9 = new javax.swing.JLabel();


jLabel10 = new javax.swing.JLabel();


jLabel11 = new javax.swing.JLabel();


jLabel12 = new javax.swing.JLabel();


jLabel13 = new javax.swing.JLabel();


jR
adioButton8 = new javax.swing.JRadioButton();


sutotal = new javax.swing.JTextField();



getContentPane().setLayout(null);



jLabel1.setText("Altura");


getContentPane().add(jLabel1);


jLabel1.setBounds(50, 20, 29, 14);



jLabel2.setText("Largura");






getContentPane().add(jLabel2);


jLabel2.setBounds(50, 50, 70, 14);



jLabel3.setText("Comprimento");


getContentPane().add(jLabel3);


jLabel3.setBounds(50, 90, 80, 14);



jLabel
5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel5.setText("Desconto");


getContentPane().add(jLabel5);


jLabel5.setBounds(40, 180, 70, 15);


getContentPane().add(alt);


alt.setBounds(130, 20, 60, 20);


getContentPane().add(larg);


larg.setBounds(130, 50, 60, 20);


getContentPane().add(comp);


comp.setBounds(130, 80, 60, 20);


getContentPane().add(jRadioButton1);


jRadioButton1.setBounds(340, 20, 20, 21);



getContentPane().add(jRadioButton2);


jRadioButton2.setBounds(340, 50, 20, 21);


getContentPane().add(jRadioButton3);


jRadioButton3.setBounds(340, 80, 20, 21);


getContentPane().add(jRadioButton4);


jRadioButton4.setBounds(50, 210, 21, 21);


getContentPane().add(jRadioButton5);


jRadioButton5.setBounds(50, 240, 21, 21);






getContentPane().add(jRadioButton6);


jRadioButton6.setBounds(50, 270, 21, 21);


getContentPane()
.add(jRadioButton7);


jRadioButton7.setBounds(50, 300, 21, 21);



jButton1.setText("Total Betão");


jButton1.addActionListener(new java.awt.event.ActionListener() {


public void actionPerformed(java.awt.event.ActionEvent evt
) {


jButton1ActionPerformed(evt);


}


});


getContentPane().add(jButton1);


jButton1.setBounds(20, 140, 100, 23);


getContentPane().add(tot_betao);


tot_betao.setBounds(130, 140, 60, 20);



jButton3.setText("LIMPAR");


getContentPane().add(jButton3);


jButton3.setBounds(330, 370, 69, 23);


getContentPane().add(tot);


tot.setBounds(180, 330, 120, 20);



jLabel4.setText("3%");


getContentPane().
add(jLabel4);


jLabel4.setBounds(90, 210, 17, 14);



jLabel6.setText("5%");






getContentPane().add(jLabel6);


jLabel6.setBounds(90, 240, 17, 14);



jLabel7.setText("7%");


getContentPane().add(jLabel7);


jLab
el7.setBounds(90, 270, 17, 14);



jLabel8.setText("10%");


getContentPane().add(jLabel8);


jLabel8.setBounds(80, 300, 23, 14);



jLabel9.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel9.setText("Betão");



getContentPane().add(jLabel9);


jLabel9.setBounds(380, 10, 70, 15);



jLabel10.setText("c20/25");


getContentPane().add(jLabel10);


jLabel10.setBounds(380, 30, 33, 14);



jLabel11.setText("c25/30");


getContentPane().add(jLabel11);


jLabel11.setBounds(380, 60, 33, 14);



jLabel12.setText("c30/35");


getContentPane().add(jLabel12);


jLabel12.setBounds(380, 90, 33, 14);







jLabel13.setText("c12");


getContentPane(
).add(jLabel13);


jLabel13.setBounds(380, 120, 17, 14);


getContentPane().add(jRadioButton8);


jRadioButton8.setBounds(340, 110, 21, 21);


getContentPane().add(sutotal);


sutotal.setBounds(320, 140, 100, 20);


}// </ed
itor
-
fold>



private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

float altura,largura,comprimento,total_betao;

altura=Float.parseFloat(alt.getText());

largura=Float.pars
eFloat(larg.getText());

comprimento=Float.parseFloat(comp.getText());

total_betao=altura*largura*comprimento;


// TODO add your handling code here:


}



// Variables declaration
-

do not modify


private javax.swing.JTextField alt;


private javax.swing.JTextField comp;


private javax.swing.JButton jButton1;


private javax.swing.JButton jButton3;


private javax.swing.J
Label jLabel1;


private javax.swing.JLabel jLabel10;






private javax.swing.JLabel jLabel11;


private javax.swing.JLabel jLabel12;


private javax.swing.JLabel jLabel13;


private javax.swing.JLabel jLabel2;


private javax.swing.JLabel jLabel
3;


private javax.swing.JLabel jLabel4;


private javax.swing.JLabel jLabel5;


private javax.swing.JLabel jLabel6;


private javax.swing.JLabel jLabel7;


private javax.swing.JLabel jLabel8;


private javax.swing.JLabel jLabel9;


private j
avax.swing.JRadioButton jRadioButton1;


private javax.swing.JRadioButton jRadioButton2;


private javax.swing.JRadioButton jRadioButton3;


private javax.swing.JRadioButton jRadioButton4;


private javax.swing.JRadioButton jRadioButton5;


priva
te javax.swing.JRadioButton jRadioButton6;


private javax.swing.JRadioButton jRadioButton7;


private javax.swing.JRadioButton jRadioButton8;


private javax.swing.JTextField larg;


private javax.swing.JTextField sutotal;


private
javax.swing.JTextField tot;


private javax.swing.JTextField tot_betao;


// End of variables declaration }


6/Jul/2010

Margarida Matos