Automated tests are software. Writing tests is programming. The difference is which libraries you use and what problems you are trying to solve.
But you need to distinguish between the needs of your company (where you work), and the needs of your career. How does your current work align with your interests, and where can you see yourself in the future? Talk to your manager about how you can contribute to profits of your company. Maybe the company will pay you to get training in QA test automation - take the opportunity.
But if the company is not paying for classes (or at least giving you time to learn new skills on your own while paying you salary), do what is best for your career.
To improve your skills as a software developer (regardless of the area you will apply your skills), IMHO the better return on time invested would be to learn more languages (especially if Java is the only language you are proficient in, as the title of your post suggest). Top candidates would be a dynamically typed language like Python, and Javascript for front-end development. And at least basics of CSS.
TL;DR: Yes, learn test automation if you are interested in it, or if the company pays you to do it. If not, you can gain more skills (better return on time invested) learning something different from your current skillset.