A two-dimensional (2D) numerical solution method is developed for the recently derived linear gyrokinetic system which describes arbitrary wavelength electromagnetic perturbations in tokamak plasmas. The system consists of the gyrokinetic equation, the gyrokinetic Poisson equation, and the gyrokinetic moment equation. Since familiar magnetohydrodynamic (MHD) results can be recovered entirely from this gyrokinetic model, and all interesting kinetic effects are intrinsically included, this gyrokinetic system offers an approach for kinetic MHD phenomena which is more rigorous, self-consistent, and comprehensive than the previous hybrid models. Meanwhile, drift type microinstabilities can be also investigated systematically in this theoretical framework. The linear gyrokinetic equation is solved for the distribution function in terms of the perturbed fields by integrating along unperturbed particle orbits. The solution is substituted back into the gyrokinetic moment equation and the gyrokinetic Poisson equation. When the boundary conditions are incorporated, an eigenvalue problem is formed. The resulting numerical code, KIN-2DEM, is applied to kinetic ballooning modes, internal kink modes, and toroidal Alfvén eigenmodes (TAEs). The numerical results are benchmarked against the well-established FULL code [G. Rewoldt, W. M. Tang, and M. S. Chance, Phys. Fluids 25, 480 (1982)], the PEST code [J. Manickam, Nucl. Fusion 24, 595 (1984)], and the NOVA-K code [C. Z. Cheng, Phys. Rep. 211, No. 1 (1992)]. More importantly, kinetic effects on MHD modes can be investigated nonperturbatively. In particular, the kinetic effects of the background plasma on internal kink modes and the hot particle destabilization of TAEs are studied numerically.