There's a few different train companies that operate trains in Sannomiya.  The different stations are all linked though, so it's really easy to transfer.  In fact, trains in Japan are just amazingly efficient and easy to use in general.
<a rel="nofollow" class="external text" href="https://www.flickr.com/people/28359281@N07">Joe Allen</a> from Sheffield, UK
CC BY 2.0
<a rel="nofollow" class="external text" href="https://www.flickr.com/photos/28359281@N07/3390809373/">Sannomiya JR train station</a>