private JToggleButton getButton(int tool)
    {
        switch (tool)
        {
            case TOOL_EYEDROPER:
                return eyedropper;
            case TOOL_LINE:
                return line;
            case TOOL_OVAL:
                return oval;
            case TOOL_PAINT_BUCKET:
                return pBucket;
            case TOOL_PENCIL:
                return pencil;
            case TOOL_RECTANGLE:
                return rect;
            case TOOL_ROUND_RECTANGLE:
                return roundedRect;
            case TOOL_SELECTION:
                return selection;
            default:
                return null;
        }
    }