Extending ProgressBar as a Widget in FengGUI


I'm having a problem with a widget i've made by extending a widget. when added to my window the text shows up and the background colour changes but the bar its self does not update or change no matter what i do. Running SVN version of FengGUI. If anyone can help that would be great.

Heres the offending class:


public class StatusBar extends ProgressBar {

    private int maxval;
    private float currentval;

    public StatusBar(String text) {
   super(text);
   this.setHorizontal(true);
   this.setMinSize(140, 13);
   this.setSize(140,13);
   this.getAppearance().add(new PlainBackground(Color.BLACK));
   this.getAppearance().getData().setColor(Color.WHITE);
   this.setValue(0.5);
    }
   
    public void setColor(Color col) {
   ((EntryAppearance)this.getAppearance()).setSelectionColor(col);
    }

    public void setMax(int max) {
   maxval = max;
    }

    public boolean maxSet() {
   if (maxval > 0) {
       return true;
   }
   return false;
    }

    public void updateCurrent(float current) {
   if (maxSet()) {
       if (currentval != current) {
      currentval = current;
      this.setValue(currentval / maxval);
       }
   }
    }
}




The class is used for displaying a healthbar with a max health and a current health. Its impleamented as follows:


StatusBar health = new StatusBar("Health");
health.setColor(Color.GREEN);
health.setMax(100);
health.updateCurrent(100);
window.addWidget(health);

//when the health changes
health.updateCurrent(99);

try calling layout() on containers after an update or even pack()

Thought i had that in, but no that doesn't work.

I'm having the same problem with the ProgressBar class too.  The progress is not being shown … only the text.



I'm using the latest JME, LWJGL, and FengGUI from SVN (had to update FengGUI to use LWJGL 2.0.1).



Any idea why the progress isn't being shown?  There are no errors or exceptions.



Thanks

Turns out that the default theme from SVN doesn't work correctly.  Doing something like this fixes it.


        URL url = HUDGameState.class.getClassLoader().getResource("QtCurve.xml");
        try{
            ITheme theme = new XMLTheme(url.getPath());
            FengGUI.setTheme(theme);
        }catch(Exception e){e.printStackTrace();}