Hallo
Ich programmiere zur Zeit einen "Online-Konfigurator".
Der Konfigurator soll nach der getätigten Konfiguration eine Bestellübersicht in einer Tabelle anzeigen.
Die Tabelle enthält folgende Inhalte: Modell, Material, Farbe, Abmessung, Zubehör, Preis
Die Werte sollen von der gewählten Konfiguration (Eingabemaske) übernommen werden.
Meine Frage: Wie kann ich die einzelnen Felder für die Tabelle programmieren?
Wäre froh um jegliche Hilfe. Vielen Dank.
Ich programmiere zur Zeit einen "Online-Konfigurator".
Der Konfigurator soll nach der getätigten Konfiguration eine Bestellübersicht in einer Tabelle anzeigen.
Die Tabelle enthält folgende Inhalte: Modell, Material, Farbe, Abmessung, Zubehör, Preis
Die Werte sollen von der gewählten Konfiguration (Eingabemaske) übernommen werden.
Meine Frage: Wie kann ich die einzelnen Felder für die Tabelle programmieren?
Wäre froh um jegliche Hilfe. Vielen Dank.
Java:
jLabel1.setText("Sie haben folgende Konfiguration gew\u00e4hlt:");
Bestellübersicht.setModel(new javax.swing.table.DefaultTableModel(
new Object[][] { { null, null, null, null, null, null } },
new String[] { "Modell", "Material", "Farbe", "Abmessung",
"Zubehör", "Preis" }) {
boolean[] canEdit = new boolean[] { false, false, false, false,
false, false };
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit[columnIndex];
}
});
jScrollPane1.setViewportView(Bestellübersicht);
jButton2.setText("Bestellung \u00e4ndern");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
Bestellen.setText("Bestellen");
Bestellen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BestellenActionPerformed(evt);
}
});
jButton1.setText("weitere Bestellung");
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.LEADING)
.addComponent(
jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
362,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING,
false)
.addComponent(
jScrollPane1,
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addComponent(
jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE,
141,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(
jButton1)
.addGap(77,
77,
77)
.addComponent(
Bestellen))))
.addContainerGap(25, Short.MAX_VALUE)));
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
new java.awt.Component[] { Bestellen, jButton1, jButton2 });
layout.setVerticalGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
43,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
51,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(Bestellen)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(
jButton2)
.addComponent(
jButton1)))
.addGap(25, 25, 25)));
layout.linkSize(javax.swing.SwingConstants.VERTICAL,
new java.awt.Component[] { Bestellen, jButton1 });
pack();
}// </editor-fold>
//GEN-END:initComponents
private void BestellenActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Bestellübersicht().setVisible(true);
}
});
}
//GEN-BEGIN:variables
// Variables declaration - do not modify
private javax.swing.JButton Bestellen;
private javax.swing.JTable Bestellübersicht;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane1;
// End of variables declaration//GEN-END:variables
}