Java - Casting Error in Double into String JTable

72
February 28, 2018, at 5:40 PM

I have a problem about Double Casting into String.

This error comes if I try to compile it:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String

BTW, this is my code:

       double total = 0;
        for(int i = 0; i < model.getRowCount(); i++)
        {
          int amount = Integer.parseInt((String) model.getValueAt(i, 1));
          total += amount;
        }
        tf4.setText(String.valueOf(total));
READ ALSO
RestTemplate Request/Response simple JSON-String

RestTemplate Request/Response simple JSON-String

Does any body have samples of SpringBoot - RequestTemplate for get/post a simple raw JSON Template like below example

155
How to trace location of any product using their RFID Card Number?

How to trace location of any product using their RFID Card Number?

How to trace a location using RFID card? How to used this card inside the android application?

75
Use a single Google Drive account to share a Keepass Database and Sync multiple devices

Use a single Google Drive account to share a Keepass Database and Sync multiple devices

Apologies if this is the wrong threadMods please feel free to move to the appropriate category

66