Progress bars in Java

I'm building a tamagotchi game foe a module, i want to use progress bars to show the happy, energy etc.  However i am struggling on laying the multiple bars in the interface out and adjusting the height and width.

I assume you are building a standalone Swing app, and are not building a JSF Web App?

Progress bars in Swing can be a pain to configure.

If you are not too far along with your development, I would recommend using NetBeans to build your Swing GUI.  NetBeans' Gui Builder is really good, easy to use, lets you drag and drop components--JProgessBar being one of them--onto your JFrame, resize them, move them around, and set other properties.

The hard part is updating/resetting the JProgressBar.  For that you need to use a SwingWorker Thread.  I put a simple example of creating and updating a Swing JProgress bar on pastebin:

If you still plan to hand jam the progress bar layout and settings, take a look at the initComponents() method.  It contains the layout and sizing info for the progress bar.

If you are using JSF to build a web application, I would recommend using PrimeFaces' <p:progressBar/> component.  You can see lots of examples for how to use their progress bar component on Primefaces' website: