private List<String> wrapText(FontRenderContext context, String text, int width)
	{
		int MAX_WIDTH = width - LEFT_MARGIN - RIGHT_MARGIN;
		
		List<String> result = new ArrayList<String>();
		
		try(Scanner scanner = new Scanner(text))
		{			
			scanner.useDelimiter("\\s+");
			
			String line = "";
			
			while(scanner.hasNext())
			{				
				String word = scanner.next();
				
				if(line.length() == 0)
				{
					// Each line must have at least one word (even if
					// it doesn't fit)
					line = word;
				}
				else
				{
					// Check to see if the line can fit another word
					String newLine = line + " " + word;
					
					Rectangle2D bounds = font.getStringBounds(newLine, context);
					if(bounds.getWidth() <= MAX_WIDTH)
					{
						line = newLine;
					}
					else
					{
						result.add(line);
						line = word;
					}
				}
			}
			
			if(line.length() > 0)
			{
				result.add(line.toString());
			}
		}
		
		return result;
	}