In order to integrate Java applications with the Unity bar you will need an external library. There is one called Java Ayatana that you can get from a PPA. Instructions are on that page but I'll put them here
sudo add-apt-repository ppa:danjaredg/jayatana
sudo apt-get update
sudo apt-get install jayatana
You will need to log out and back in after installing. The instructions here will install the latest version and will keep up to date, the link I put in my comment above is outdated and must be manually installed so I recommend you use this instead.
From the page I linked above there is a tab labeled "wiki" which has a file "configuration". This file explains how to set up a Java program to utilize the Unity top bar. You will need to create a Java desktop application (