private void createLayout(){
  JComponent content=SBoxLayout.createContainer(SBoxLayout.VERTICAL,PADDING);
  JComponent row=SBoxLayout.createContainer(SBoxLayout.HORIZONTAL,PADDING);
  JComponent left=SBoxLayout.createContainer(SBoxLayout.VERTICAL,PADDING);
  JComponent middle=SBoxLayout.createContainer(SBoxLayout.VERTICAL,PADDING);
  JComponent right=SBoxLayout.createContainer(SBoxLayout.VERTICAL,PADDING);
  left.setAlignmentY(CENTER_ALIGNMENT);
  right.setAlignmentY(CENTER_ALIGNMENT);
  row.add(left);
  row.add(middle);
  row.add(right);
  content.add(row);
  Class<? extends IEntity> itemClass=EntityMap.getClass("item",null,null);
  SpriteStore store=SpriteStore.get();
  left.add(Box.createVerticalStrut(HAND_YSHIFT * 2));
  ItemPanel panel=createItemPanel(itemClass,store,"rhand","data/gui/weapon-slot.png");
  left.add(panel);
  panel=createItemPanel(itemClass,store,"finger","data/gui/ring-slot.png");
  left.add(panel);
  panel=createItemPanel(itemClass,store,"head","data/gui/helmet-slot.png");
  middle.add(panel);
  panel=createItemPanel(itemClass,store,"armor","data/gui/armor-slot.png");
  middle.add(panel);
  panel=createItemPanel(itemClass,store,"legs","data/gui/legs-slot.png");
  middle.add(panel);
  panel=createItemPanel(itemClass,store,"feet","data/gui/boots-slot.png");
  middle.add(panel);
  right.add(Box.createVerticalStrut(HAND_YSHIFT * 2));
  panel=createItemPanel(itemClass,store,"lhand","data/gui/shield-slot.png");
  right.add(panel);
  panel=createItemPanel(itemClass,store,"cloak","data/gui/cloak-slot.png");
  right.add(panel);
  specialSlots=SBoxLayout.createContainer(SBoxLayout.HORIZONTAL,PADDING);
  specialSlots.setAlignmentX(CENTER_ALIGNMENT);
  specialSlots.setVisible(false);
  content.add(specialSlots);
  panel=createItemPanel(itemClass,store,"back","data/gui/bag-slot.png");
  specialSlots.add(panel);
  panel=createItemPanel(itemClass,store,"belt","data/gui/key-slot.png");
  specialSlots.add(panel);
  setContent(content);
}

private void createLayout ( ) { JComponent content = SBoxLayout . createContainer ( SBoxLayout . VERTICAL , PADDING ) ; JComponent row = SBoxLayout . createContainer ( SBoxLayout . HORIZONTAL , PADDING ) ; JComponent left = SBoxLayout . createContainer ( SBoxLayout . VERTICAL , PADDING ) ; JComponent middle = SBoxLayout . createContainer ( SBoxLayout . VERTICAL , PADDING ) ; JComponent right = SBoxLayout . createContainer ( SBoxLayout . VERTICAL , PADDING ) ; left . setAlignmentY ( CENTER_ALIGNMENT ) ; right . setAlignmentY ( CENTER_ALIGNMENT ) ; row . add ( left ) ; row . add ( middle ) ; row . add ( right ) ; content . add ( row ) ; Class < ? extends IEntity > itemClass = EntityMap . getClass ( "item" , null , null ) ; SpriteStore store = SpriteStore . get ( ) ; left . add ( Box . createVerticalStrut ( HAND_YSHIFT * 2 ) ) ; ItemPanel panel = createItemPanel ( itemClass , store , "rhand" , "data/gui/weapon-slot.png" ) ; left . add ( panel ) ; panel = createItemPanel ( itemClass , store , "finger" , "data/gui/ring-slot.png" ) ; left . add ( panel ) ; panel = createItemPanel ( itemClass , store , "head" , "data/gui/helmet-slot.png" ) ; middle . add ( panel ) ; panel = createItemPanel ( itemClass , store , "armor" , "data/gui/armor-slot.png" ) ; middle . add ( panel ) ; panel = createItemPanel ( itemClass , store , "legs" , "data/gui/legs-slot.png" ) ; middle . add ( panel ) ; panel = createItemPanel ( itemClass , store , "feet" , "data/gui/boots-slot.png" ) ; middle . add ( panel ) ; right . add ( Box . createVerticalStrut ( HAND_YSHIFT * 2 ) ) ; panel = createItemPanel ( itemClass , store , "lhand" , "data/gui/shield-slot.png" ) ; right . add ( panel ) ; panel = createItemPanel ( itemClass , store , "cloak" , "data/gui/cloak-slot.png" ) ; right . add ( panel ) ; specialSlots = SBoxLayout . createContainer ( SBoxLayout . HORIZONTAL , PADDING ) ; specialSlots . setAlignmentX ( CENTER_ALIGNMENT ) ; specialSlots . setVisible ( false ) ; content . add ( specialSlots ) ; panel = createItemPanel ( itemClass , store , "back" , "data/gui/bag-slot.png" ) ; specialSlots . add ( panel ) ; panel = createItemPanel ( itemClass , store , "belt" , "data/gui/key-slot.png" ) ; specialSlots . add ( panel ) ; setContent ( content ) ; }
create the content layout and add the itempanels .
