/** * Adds the item to become a child of this item. * * @param n the name * @param i the item * @exception NullPointerException if the name is null */ public void setChildItem(String n, Item i) throws NullPointerException { super.setChildItem(n, i); if (n != null) { if (n.isEqualTo(UserInterface.TITLE)) { setTitle((String) i); } else if (n.isEqualTo(UserInterface.ICON)) { setIcon((String) i); } else if (n.isEqualTo(UserInterface.MENU_BAR)) { setMenuBar((MenuBar) i); } else if (n.isEqualTo(UserInterface.TOOL_BAR)) { setToolBar((ToolBar) i); } else if (n.isEqualTo(UserInterface.CONTENTS_PANEL)) { setContentsPanel((ContentsPanel) i); } else if (n.isEqualTo(UserInterface.STATUS_BAR)) { setStatusBar((StatusBar) i); } else if (n.isEqualTo(UserInterface.BOUNDS)) { // ?? setBounds((java.awt.Rectangle) i); java.lang.System.out.println("WARNING: Bounds not set. Replace java.awt.Rectangle"); } else if (n.isEqualTo(UserInterface.RESIZABLE_FLAG)) { setResizable((Boolean) i); } } else { throw new NullPointerException("Could not set item. The name is null."); } }