×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Peter Wendel
Added: Apr 9, 2015 9:24 AM
Modified: Apr 18, 2015 2:13 PM
Views: 38
You don't have to code every case, when most of them end up in the same datatype.

Default: String
  1. Class xx;
  2.        
  3.            switch(columnIndex) {
  4.        
  5.             case 5:
  6.                 xx = Date.class;
  7.                 break;
  8.             case 7:
  9.                 xx = int.class;
  10.                 break;
  11.             case 8:
  12.                 xx = int.class;
  13.                 break;
  14.             case 9:
  15.                 xx = int.class;
  16.                 break;
  17.             case 10:
  18.                 xx = int.class;
  19.                 break;
  20.             default:
  21.                 xx = String.class;
  22.             }
  23.        
  24.         return xx;

1 comment

Peter Wendel 2 years ago
Divide the Datatypes in an TableModel.

Write a comment