App doesnt stay active

I have an app for Java. When I run the app by double click on it, the app window deactivates, so I have to click on it to be active again. Is this problem caused by Ubuntu, or by the app? If by Ubunutu, how to force it to stay active?