public Tile(final int x, final int y) {
        type = TileType.getTileType(x, y);
        switch (type) {
            case DOUBLE_LETTER:
                letterBonus = 2;
                wordBonus = 1;
                break;
            case DOUBLE_WORD:
                letterBonus = 1;
                wordBonus = 2;
                break;
            case TRIPLE_LETTER:
                letterBonus = 3;
                wordBonus = 1;
                break;
            case TRIPLE_WORD:
                letterBonus = 1;
                wordBonus = 3;
                break;
            default:
                letterBonus = 1;
                wordBonus = 1;
                break;
        }
        location = new Point(x, y);
        setBackground(type.getColor());
        setFont(new Font(Font.MONOSPACED, Font.BOLD, 20));
        setText(letter);
        setFocusable(false);
        addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                final String curText = getText();
                final JTextField input = new JTextField(new CharLimit(1), (curText.equals(" ") ? "" : curText), 1);
                final Object[] info = { "Enter a letter", input };
                final int returnVal = JOptionPane.showConfirmDialog(null, info, "Input", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
                if (returnVal == JOptionPane.OK_OPTION) {
                    final String enteredVal = input.getText();
                    if (enteredVal.equals(" ") || Pattern.matches("[a-zA-Z]+", enteredVal)) {
                         setLetter(enteredVal.charAt(0));
                    } else {
                        JOptionPane.showMessageDialog(null, "Invalid character entered", "Warning", JOptionPane.WARNING_MESSAGE);
                        actionPerformed(e);
                    }
                }
            }
        });
    }