package org.ui;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;


public class UICreator {
    public static JButton createIconifiedButton(char iconCharacterCode) {
        final JButton button = new JButton(String.valueOf(iconCharacterCode));

        button.setFont(new Font("RTX-GYTEBOT-ICONS", 0, 28));
        button.setFocusPainted(false);
        button.setContentAreaFilled(false);
        button.setBorder(BorderFactory.createEmptyBorder(2, 10, 2, 10));
        button.setOpaque(false);

        button.addMouseListener(new MouseAdapter() {
            public void mouseEntered(MouseEvent event) {
                button.setCursor(new Cursor(12));
            }


            public void mouseExited(MouseEvent event) {
                button.setCursor(new Cursor(0));
            }
        });

        return button;
    }
}