myTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{"Rent/Mortgage", null},
{"Water", null},
{"Electricity", null},
{"Cable/Internet", null},
{"Car", null},
{"Groceries", null},
{"Clothing", null},
{"Gas", null},
{null, null},
{null, null}
},
new String [] {
"Item", "Amount"
...
private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {
calculateButton.setBackground(Color.lightGray);
...}
I'm trying to figure out how to put 0.00 in the cells currently marked as null. (This is a calculator, trying to set the amounts to zero upon clicking my clear button.) I've tried a plethora of for loops with none of them working like I'd like. I suppose I just don't understand JTable just yet. Thanks in advance for any help.


Sign In
Create Account

Back to top









