I have several jButtons, jFrames and jPanels in my program that are all interconnected and have several functionalities that I do not want to get rid of if I can help it. I wrote all of this code before I integrated my project into jME, and I tested today in jME and all of the JSwing components are working correctly. In the FAQ I read about you having to implement jME specific listeners and components, is this true? It appears to me that these Swing components DO work in jME so if I am allowed to use these components, how would I go about drawing 3D objects in jME to my jPanel? As of right now, I have two jFrames: the title page, where there are 3 buttons of which you click one to decide your class, and this moves you to the next jFrame, the game frame. The game frame has rectangles representing health bars which are very choppy and square looking along with several buttons with images and tooltips corresponding to your chosen class. My question is should I use Swing in its entirety for the few things I am looking for or rather implement a Nifty GUI that includes these components.
A summary of my two questions are the following:
- How should I alter my code for a jME program to function smoothly? Should I leave it in Swing, or if not, how can I implement JComponents in the Nifty GUI? The Nifty GUI tutorial talks about panels and screens and containers, but I am not sure which of these directly relate the the Java swing components or if they are completely separate Nifty components.
- How should I go about making a jRectangle less choppy? If it’s meant to be a 2D flat image of a health bar, how should I more smoothly assimilate the flat image into the 3D surrounding environment?
Thank you for your time.
Edit: Changed my question after reviewing the Nifty tutorial section.