private long InstancesCount() { String sIname = ClassNameTF.getText().trim(); long lNumberOfInstance = 0; if (sIname.length() > 0) { String sClassName = ClassNameTF.getText(); try { Cls cls = kb.getCls(sClassName); Collection colInstances = kb.getInstances(cls); lNumberOfInstance = colInstances.size(); } catch (Exception e) { theLogger.severe("Class not found"); } } else { try { Collection colInstances = kb.getInstances(); lNumberOfInstance = colInstances.size(); } catch (Exception e) { theLogger.severe("Class not found"); } } return lNumberOfInstance; }