int wrap(Graphics g, int width, ArrayList<String> list) {
            int lastNewLine = 0, lastSpace = 0, w = 0, maxw = 0;
            for (int i = 0; i < info.length(); ++i) {
                if (info.charAt(i) == ' ') {
                    w += g.getFontMetrics().stringWidth(info.substring(lastSpace, i + 1));
                    if (w >= width) {
                        list.add(info.substring(lastNewLine, i));
                        maxw = Math.max(g.getFontMetrics().stringWidth(list.get(list.size() - 1)),
                                maxw);
                        w = 0;
                        lastNewLine = i + 1;
                    }
                    lastSpace = i + 1;
                }
            }
            if (lastNewLine < info.length()) {
                list.add(info.substring(lastNewLine));
                maxw = Math.max(g.getFontMetrics().stringWidth(list.get(list.size() - 1)), maxw);
            }
            list.add("");
            return maxw;
        }