Here you can find the source of setFieldValue(String fieldName, int fieldValue, Object board)
public static void setFieldValue(String fieldName, int fieldValue, Object board)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Field; public class Main { public static void setFieldValue(String fieldName, int fieldValue, Object board) { Field field;/*from w w w . j a v a2s . c o m*/ try { field = board.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(board, fieldValue); } catch (NoSuchFieldException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } }