You are currently offline, waiting for your internet to reconnect

FIX: DhCell.resetTextAlign() does not update cell display

This article was previously published under Q197567
DhCell.resetTextAlign(), which sets the cell text alignment property backto match the alignment property of the row the cell is in, does not work.
To work around this issue, set the text-align style in your Cascading StyleSheet (CSS) to an empty string. For example, for a DhCell called "cell,"you would do the following:
cell.setCSSStyle("text-align", "");				
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

Steps to Reproduce Behavior

  1. In Visual J++, select New Project from the File menu.
  2. In the New Project dialog box, click the New tab.
  3. In the Visual J++ Projects tree, click Web Pages.
  4. Click Code-Behind HTML.
  5. Click Open to create the project.
  6. Modify as follows:
    import*;import*;import*;public class Class1 extends DhDocument{   public Class1()   {      initForm();   }   private void initForm()   {   }   protected void onDocumentLoad(Object sender, Event e)   {      DhTable table=new DhTable();      add(table);      DhRow row=new DhRow();      table.add(row);      DhCell cell=new DhCell("Testing");      row.add(cell);      cell.setWidthUnit(200,DhUnits.PIXEL);      cell.setBackColor(Color.LIGHTGRAY);      cell.setTextAlign(DhAlignment.RIGHT);      cell.resetTextAlign();// Workaround: Uncomment the next line and comment// out the line above for the workaround.//    cell.setCSSStyle("text-align", "");   }}						
  7. Modify Page1.html as follows:
    <HTML><BODY><hr><OBJECT classid=""     height=0 width=0 ... VIEWASTEXT><PARAM NAME=__CODECLASS VALUE=Class1><PARAM NAME=CABBASE VALUE=Project1.CAB></OBJECT><!-- Insert HTML here --></BODY></HTML>						
  8. Run the project.
RESULT: The Web page contains the word "Testing," which is right-aligned and appears in a gray box, instead of the default, which is left-aligned.
For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

Article ID: 197567 - Last Review: 06/14/2006 20:20:00 - Revision: 3.0

Microsoft Visual J++ 6.0 Standard Edition, Microsoft Software Development Kit for Java 3.1

  • kbbug kbfix kbjava kbhtml kbwfc kbvs600sp3fix KB197567