@Override
	public void paint(Graphics g) {
		try {
			ImageIcon img = null;
			if ("".equals(modal)) {
				img = new ImageIcon(this.getClass().getResource(
						"/images/" + name + ".png"));
			} else {
				img = new ImageIcon(this.getClass().getResource(
						"/images/" + name + "_" + modal + ".png"));
			}
			if (img.getImage() != null)
				g.drawImage(img.getImage(),
						(getWidth() - img.getIconWidth()) / 2,
						(getHeight() - img.getIconHeight()) / 2, image);
		} catch (NullPointerException e) {
			// super.paint(g);
		}
		if (textPanel != null) {
			g.setColor(Color.BLACK);
			g.setFont(textPanel.getFont());
			g.drawString(textPanel.getText(), (int) (getWidth() - textPanel
					.getPreferredSize().getWidth()) / 2 + 1,
					getHeight() / 2 + 7);
			textPanel.paint(g);
		}
	}