By train it's a little harder. depending on where you're coming from, you can train it to venice and then Trieste. from Venice, again, depending on what time of year, you can catch a ferry to Rijeka, Zadar, split or Dubrovnik. There is also a local ferry service that's fun to catch down the adriatic coastline as you go through the islands like Hvar and Korcula. You can also choose to go by bus which is cheap and comfortable. I think the euro whatever train goes to Zagreb but if you're coming during the warmer months, I recommmend the coastline as it's really pretty.
there is always the option of planes too.
Best of luck,