Here you can find the source of installSimpleRenderesAndEditors(JTable table)
public static void installSimpleRenderesAndEditors(JTable table)
//package com.java2s; //License from project: Apache License import javax.swing.*; import java.util.HashMap; import java.util.Map; public class Main { public static void installSimpleRenderesAndEditors(JTable table) { Map<Class, Class> map = new HashMap<Class, Class>(); map.put(boolean.class, Boolean.class); map.put(byte.class, Number.class); map.put(short.class, Number.class); map.put(int.class, Number.class); map.put(long.class, Number.class); map.put(float.class, Number.class); map.put(double.class, Number.class); for (Class newType : map.keySet()) { Class existingType = map.get(newType); table.setDefaultRenderer(newType, table.getDefaultRenderer(existingType)); table.setDefaultEditor(newType, table.getDefaultEditor(existingType)); }/*from w w w .ja va 2 s. co m*/ } }