Dealing with displaying inspectors is one of the many things that the Console object does and unfortunately the only way to really modify the way inspectors are listed is by subclassing the Console object.
The easiest way to do it would be as follows. Probably in your main method with the GUI looks something like this:
public static void main(String[] args)
{
YourSimState state = new YourSimState(1);
YourGUIState gui = new YourGUIState(state);
Console c = new Console(gui);
c.setVisible(true)
}
Now you subclass console anonymously like this:
public static void main(String[] args)
{
YourSimState state = new YourSimState(1);
YourGUIState gui = new YourGUIState(state);
Console c = new Console(gui)
{
public void setInspectors(Bag inspectors, Bag names)
{
//sort the two bags here!
super.setInspectors(inspectors, names);
};
c.setVisible(true)
}
where you provide your sorting behavior where the comment is.
Notice that you are dealing with two bags, not a LinkedHashMap so you need to be extra careful that whatever ordering you assign to the inspector bag is also the order you assign to the names bag, but that's really about it.
Ideally you'd like to change the way your display/portrayal calls the console's "setInspectors" instead. Unfortunately displays are also pretty complicated objects that juggle many responsibilities and you'd have to track and override every time they call setInspectors which I think it's harder to do.
Hope this helps!