public String getMouseHover(Vector2f v) { for (RectangleShape r : rects) { if (r.getGlobalBounds().contains(v)) { String result = r.toString(); if (result.contains("buttonGrid")) { result = ""; try { result = ((ButtonGrid) r).getButton(v).toString(); } catch (Exception e) { } } if (result.equals("")) return null; return result; } } return null; }