@Override
    public void paintComponent(Graphics g)
    {
        Graphics2D g2d = (Graphics2D)g;
        FontMetrics fontMetrics = null;

        if (isLoading)
        {
            g2d.setColor(loadingBgColor);
        }
        else if (isSelected())
        {
            g2d.setColor(selectedBgColor);
        }
        else
        {
            g2d.setColor(Color.white);
        }
        g2d.fillRect(0, 0, getWidth(), getHeight());

        g2d.setColor(Color.black);
        g2d.setFont(versionFont);
        fontMetrics = g2d.getFontMetrics();
        int versionNameX = getWidth() - 40 - fontMetrics.stringWidth(profile.getVersionName());
        g2d.drawString(profile.getVersionName(), versionNameX, 20);

        g2d.setColor(Color.black);
        g2d.setFont(nameFont);
        if (oldWidth != getWidth())
        {
            fontMetrics = g2d.getFontMetrics();
            String name = profile.getProfileName();
            if (fontMetrics.stringWidth(name) > versionNameX - 25)
            {
                int widthSum = 0;
                for (int i = 0; i < name.length(); i++)
                {
                    widthSum += fontMetrics.charWidth(name.charAt(i));
                    if (widthSum > versionNameX - 25)
                    {
                        name = name.substring(0, i) + "...";
                        break;
                    }
                }
            }
            drawName = name;
            oldWidth = getWidth();
        }
        g2d.drawString(drawName, 5, 30);

        g2d.setColor(Color.gray);
        g2d.setFont(statusFont);
        fontMetrics = g2d.getFontMetrics();
        String statusString = profile.getStatus().toString();
        g2d.drawString(statusString, getWidth() - 40 - fontMetrics.stringWidth(statusString), 32);

        BufferedImage image = inactiveIcon;
        if (isLoading)
        {
            image = loadingIcon;
        }
        else if (profile.getStatus() == Status.FOUND)
        {
            image = activeIcon;
        }
        g2d.drawImage(image, getWidth() - image.getWidth() - 5, 4, null);
    }