how to set center alignment in JTable?

From: lucy (losemind_at_yahoo.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 11:56:06 -0700

Hi, I've used the following to set the alignment for cells in JTable...

ttt.setAlignmentX(0.5);
ttt.setAlignmentY(0.5);

where ttt is a JTable object,

but it did not work at all,... (the JTable display shows no change at
all...)

What's the problem?



Relevant Pages

  • Updating JTable Cells with Custom Renderer
    ... I currently have a JTable object that utilizes the DefaultTableModel ... and "Column C" and all are text cells. ... boolean variable that is equal to that flag. ...
    (comp.lang.java.programmer)
  • Updating JTable Cells with Custom Renderer
    ... I currently have a JTable object that utilizes the DefaultTableModel ... and "Column C" and all are text cells. ... boolean variable that is equal to that flag. ...
    (comp.lang.java.help)
  • Re: alignment of pasted text with line breaks is altered in table
    ... the cells that look otherwise have special formatting applied on top ... If you select the text in one of the properly formatted cells ... If I just paste it outside of a table, the correct alignment is ...     On Error GoTo oops ...
    (microsoft.public.word.docmanagement)
  • Re: how to set center alignment in JTable?
    ... I've used the following to set the alignment for cells in JTable... ... The DefaultTableCellRenderer is actually just a JLabel which JTable uses to ... Then you need to apply this renderer to your JTable. ...
    (comp.lang.java.programmer)
  • Re: Table Alignment problem
    ... > now I have a problem with the size of the table cells. ... My prob is that the alignment is incorrect. ... The third column I left ... >> with the left justify. ...
    (microsoft.public.frontpage.client)