/** * */ package e4s.tutorial; import e4s.html.*; import e4s.servlet.E4ModuleImplementation; /** * Highlight the current table row. This is a special function, it changes * the color (or style) of an table row when the mouse gets over it. It * is quite simple. * * {@tutorial Example_Table_Highlight} */ public class Example_Table_Highlight extends E4ModuleImplementation { public static E4Method start = null; public void start(HTML html) { html.setTitle("Table Highlight Example"); BODY body = html.BODY(); TABLE table = body.TABLE(); table.setCellspacing(1); table.setBgColor(E4Color.GRAY); table.setFONT(FONT.ARIAL_smaller); for( int row = 1; row <= 20; row++ ) { TR tr = table.TR(); tr.setBgColor(new E4Color(0xFF,0xFF / 20 * row,0x00)); tr.setHighlightColor(E4Color.WHITE); for( int col = 1; col <= 10; col++ ) { if ((row % 5) == col) tr.TD().print(NBSP); else tr.TD().print(row + "." + (char)(col - 1 + 65)); } } } }