d.print("<td class=\"").print(fStyleSheet.getInnerBorderTopStyle().getName()).print("\">");
d.print("<td valign=\"top\" class=\"").print(fStyleSheet.getInnerBorderTopStyle().getName()).print("\">");
    public void write(Device d, SComponent c)        throws IOException    {        SMenuPane pane = (SMenuPane) c;        int i = 0;        int maxSubMenuCount = 0;        int menuCount = pane.getMenuCount();        MenuButtonCG menuButtonCG = new MenuButtonCG();		        // get max count of submenu items in each menu        // and test for activated menues        for (i=0; i<menuCount;i++) {            SMenu menu = pane.getMenu(i);        	maxSubMenuCount = Math.max(                maxSubMenuCount,                menuCount-i+menu.getMenuComponentCount());        }		System.out.println("maxSubMenuCount="+maxSubMenuCount);				// now getting or trying to guess the menu width		int menuWidth = pane.getMenuWidth();		if (pane.getMenuWidth() == -1) // nothin' set -> calculate it		{		    if (fMenuFont == null) {			    fMenuFont = new Font("SansSerif", Font.PLAIN, 12);			    // fMenuFont = fMenuFont.deriveFont();		    	System.out.println("Font:"+fMenuFont);		    }		    if (fGraphics == null) {		    	GraphicsEnvironment ge =                     GraphicsEnvironment.getLocalGraphicsEnvironment();			    /*			    String[] ffamilies = ge.getAvailableFontFamilyNames();			    for (int s=0;s<ffamilies.length;s++)			    	System.out.println("Font : " + ffamilies[s]);			     */		    	fGraphics = ge.createGraphics(                    new BufferedImage(1,1,BufferedImage.TYPE_USHORT_GRAY));		    }		    FontMetrics metrics = fGraphics.getFontMetrics(fMenuFont);		    for (i=0; i<menuCount; i++) {		        SMenu menu = pane.getMenu(i);		    	menuWidth = Math.max(metrics.stringWidth(menu.getText()), menuWidth);		    	SIcon icn = menu.getIcon();		    	if (icn != null) {		    	    menuWidth = Math.max(icn.getIconWidth(), menuWidth);		    	}		    	for (int mi=0;mi<menu.getMenuComponentCount(); mi++) {		    	    SMenuItem item = (SMenuItem) menu.getMenuComponent(mi);		    	    icn = item.getIcon();			    	if (icn != null) {			    	    menuWidth = Math.max(icn.getIconWidth(), menuWidth);			    	}		    	    menuWidth = Math.max(		    	    	metrics.stringWidth(item.getText()),menuWidth);		    	}		    }		    menuWidth+=20; // add 10px space left and right		}			        d.print("<!-- Menu Pane -->\n");		d.print("<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" class=\"")			.print(fStyleSheet.getMenuStyle().getName())			.print("\" ");		if (c.getPreferredSize() != null)        {            d.print("width=\"").print(c.getPreferredSize().getIntWidth()).print("\" ");            d.print("height=\"").print(c.getPreferredSize().getIntHeight()).print("\"");        }		d.print(">");		d.print("<tr>");		writeHorizontalFrame(d);		d.print("</tr><tr>\n");	    d.print("  <td rowspan=\"2\" width=\"3\" class=\"").	    	print(fStyleSheet.getOuterBorderStyle().getName()).	    	print("\">");	    org.wings.plaf.xhtml.Utils.printBlindIcon(d, fBlindImage, 3, 3);	    d.print("</td>\n");	    d.print("<td class=\"").print(fStyleSheet.getInnerBorderTopStyle().getName()).print("\">");        d.print("<table border=\"1\" height=\"1%\" cellspacing=\"0\" cellpadding=\"3\" width=\"");        d.print(menuWidth);        // small trick for konqueror(set and delete border to enable         // cell-border drawing on table with no border)        d.print("\" border=1 style=\"border: none;\">\n");        // write menus        SMenu menu = null;        int m = 0;        for (;m<pane.getMenuCount(); m++) {            menu = pane.getMenu(m);			menu.setCG(menuButtonCG);			menu.setStyle(fStyleSheet.getMenuLinkStyle());            writeMenu(d, menu);            if (menu.isActive())            	break;        }        int subMenuCount = menu.getMenuComponentCount();        /* write maxSubMenuCount - 1 rows, if last menu is opened */        int absRows = pane.getMenuCount() - 1 == m?maxSubMenuCount-1:maxSubMenuCount;        for (i=0;i<absRows;i++) {            d.print("     <tr>\n");            d.print("      <td class=\"")            	.print(fStyleSheet.getMenuItemBgStyle().getName())            	.print("\">");            if (i<subMenuCount) {                SMenuItem submenu = (SMenuItem) menu.getMenuComponent(i);                submenu.setCG(menuButtonCG);                submenu.setStyle(fStyleSheet.getMenuItemStyle());            	submenu.write(d);            }            else {                d.print("&nbsp;");            }            d.print("</td>\n");            d.print("     </tr>\n");        }		d.print("   </table>");		d.print("</td>\n");		d.print("  <td rowspan=\"2\" width=\"3\" class=\"")			.print(fStyleSheet.getOuterBorderStyle().getName())			.print("\">");		org.wings.plaf.xhtml.Utils.printBlindIcon(d, fBlindImage, 3, 3);		d.print("</td>\n");		        /* -- here goes the content -- */        d.print("  <td rowspan=\"2\" bgcolor=\"#FFFFFF\" class=\"")        	.print(fStyleSheet.getContentInnerBorderStyle().getName())        	.print("\" ");        org.wings.plaf.xhtml.Utils.printTableCellAlignment(            d,            ((SCardLayout) pane.getLayout()).getVisibleComponent());        d.print(">\n");        // save dimension and color of panel and remove it then        SDimension dim = pane.getPreferredSize();        Color color = pane.getBackground();        pane.setPreferredSize(null);        pane.setBackground(java.awt.Color.white);        // write content panel        org.wings.plaf.xhtml.Utils.writeContainerContents(d, pane);                /* -- content end -- */                // restore old dimension and color        pane.setPreferredSize(dim);        pane.setBackground(color);                d.print("  </td>\n");        d.print("  <td rowspan=\"2\" width=\"3\" class=\"")			.print(fStyleSheet.getOuterBorderStyle().getName())			.print("\">");        org.wings.plaf.xhtml.Utils.printBlindIcon(d, fBlindImage, 3, 3);        d.print("</td>\n");		d.print(" </tr><tr>\n");		d.print("<td valign=\"bottom\" width=\"1\" height=\"1\" class=\"")			.print(fStyleSheet.getInnerBorderBottomStyle().getName())			.print("\">\n");		m++;		// continue menus		if (m<pane.getMenuCount()) {		    d.print("   <table width=\"");		    d.print(menuWidth);		    d.print("\" cellspacing=\"0\" cellpadding=\"3\"");	        // small trick for konqueror(set and delete border to enable 	        // cell-border drawing on table with no border)	        d.print("\" border=1 style=\"border: none;\">\n");	        for (;m<pane.getMenuCount(); m++) {	            menu = pane.getMenu(m);	            menu.setCG(menuButtonCG);				menu.setStyle(fStyleSheet.getMenuLinkStyle());	            writeMenu(d, menu);	        }			d.print("   </table>\n");		}		else			d.print("&nbsp;");		d.print("  </td>\n");		d.print(" </tr><tr>");		writeHorizontalFrame(d);		d.print("</tr>\n");		d.print("</table>");        d.print("\n<!-- Menu Pane END -->");    }