habe grad so ein bissl mit java rumprobiert. Hab mit Netbeans gearbeitet weil mir das empfohlen wurde. Hab das so wie damals mit Frontpage angefasst und fing sofort an mir eine GUI zu bauen. Ist ganz lustig aber nun wächst auch gleichzeitig das interesse. Was muss ich tun wenn ich ähm ja ein gui fertig habe, aber die daten die ich eingebe und die buttons die ich drücke nichts tun? ist ja logisch hab denen ja sozusagen nichts beigebracht. könnte sich jemand das mal bitte ansehen und mir vieleich einige tips geben?
*
* NewJPanel.java
*
* Created on 15. Mai 2007, 11:27
*/
/**
*
* @author Florian Pramme
*/
public class NewJPanel extends javax.swing.JPanel {
/** Creates new form NewJPanel */
public NewJPanel() {
initComponents();
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jTextField4 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel1.setText("Avia Lohnberechnungsprogramm 1.0");
jTextField1.setText("0");
jTextField2.setText("0");
jTextField3.setText("0");
jLabel2.setText("x Fr\u00fchschicht");
jLabel3.setText("x Sp\u00e4tschicht");
jLabel4.setText("x Nachtschicht");
jButton1.setText("Berechnen");
jLabel5.setText("Euro Gehalt");
jLabel6.setText("Bitte geben Sie die Anzahl der geleisteten Stunden ein und klicken Sie auf BERECHNEN um das Monatsgehalt zu erhalten.");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.Gro upLayout.LEADING)
.add(layout.createSequentialGroup()
.add(225, 225, 225)
.add(jLabel1)
.addContainerGap(206, Short.MAX_VALUE))
.add(layout.createSequentialGroup()
.add(19, 19, 19)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jLabel6)
.addContainerGap())
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(12, 12, 12)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.TRAILING, false)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 38, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextField3)))
.add(layout.createSequentialGroup()
.add(22, 22, 22)
.add(jTextField4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jLabel4)
.addContainerGap(421, Short.MAX_VALUE))
.add(layout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.TRAILING)
.add(jLabel2)
.add(jLabel3))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED, 118, Short.MAX_VALUE)
.add(jButton1)
.add(226, 226, 226)))
.add(layout.createSequentialGroup()
.add(34, 34, 34)
.add(jLabel5)
.addContainerGap())))))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.Gro upLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jLabel1)
.add(54, 54, 54)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(29, 29, 29)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jLabel3)
.add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(layout.createSequentialGroup()
.add(34, 34, 34)
.add(jButton1)))
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(15, 15, 15)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jLabel4)
.add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
.add(layout.createSequentialGroup()
.add(93, 93, 93)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jLabel5)
.add(jTextField4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED, 73, Short.MAX_VALUE)
.add(jLabel6)
.add(28, 28, 28))))
.add(layout.createSequentialGroup()
.add(61, 61, 61)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel2))
.addContainerGap(283, Short.MAX_VALUE))
);
}// </editor-fold>
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
// End of variables declaration
}
möchte das so wie in exel machen. die einzelnen schichten mit einem mulitplikator mulitiplizieren dann miteinander addieren um auf einen endbetrag zu kommen.
Aber wie geht das?
Danke im Voraus
*
* NewJPanel.java
*
* Created on 15. Mai 2007, 11:27
*/
/**
*
* @author Florian Pramme
*/
public class NewJPanel extends javax.swing.JPanel {
/** Creates new form NewJPanel */
public NewJPanel() {
initComponents();
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jTextField4 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel1.setText("Avia Lohnberechnungsprogramm 1.0");
jTextField1.setText("0");
jTextField2.setText("0");
jTextField3.setText("0");
jLabel2.setText("x Fr\u00fchschicht");
jLabel3.setText("x Sp\u00e4tschicht");
jLabel4.setText("x Nachtschicht");
jButton1.setText("Berechnen");
jLabel5.setText("Euro Gehalt");
jLabel6.setText("Bitte geben Sie die Anzahl der geleisteten Stunden ein und klicken Sie auf BERECHNEN um das Monatsgehalt zu erhalten.");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.Gro upLayout.LEADING)
.add(layout.createSequentialGroup()
.add(225, 225, 225)
.add(jLabel1)
.addContainerGap(206, Short.MAX_VALUE))
.add(layout.createSequentialGroup()
.add(19, 19, 19)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jLabel6)
.addContainerGap())
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(12, 12, 12)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.TRAILING, false)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 38, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextField3)))
.add(layout.createSequentialGroup()
.add(22, 22, 22)
.add(jTextField4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jLabel4)
.addContainerGap(421, Short.MAX_VALUE))
.add(layout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.TRAILING)
.add(jLabel2)
.add(jLabel3))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED, 118, Short.MAX_VALUE)
.add(jButton1)
.add(226, 226, 226)))
.add(layout.createSequentialGroup()
.add(34, 34, 34)
.add(jLabel5)
.addContainerGap())))))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.Gro upLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jLabel1)
.add(54, 54, 54)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(29, 29, 29)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jLabel3)
.add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(layout.createSequentialGroup()
.add(34, 34, 34)
.add(jButton1)))
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(15, 15, 15)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jLabel4)
.add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
.add(layout.createSequentialGroup()
.add(93, 93, 93)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jLabel5)
.add(jTextField4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.R ELATED, 73, Short.MAX_VALUE)
.add(jLabel6)
.add(28, 28, 28))))
.add(layout.createSequentialGroup()
.add(61, 61, 61)
.add(layout.createParallelGroup(org.jdesktop.layou t.GroupLayout.BASELINE)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel2))
.addContainerGap(283, Short.MAX_VALUE))
);
}// </editor-fold>
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
// End of variables declaration
}
möchte das so wie in exel machen. die einzelnen schichten mit einem mulitplikator mulitiplizieren dann miteinander addieren um auf einen endbetrag zu kommen.
Aber wie geht das?
Danke im Voraus
Comment