我有Jtable
个自定义单元格'渲染器,应将其内容与右对齐:
public class BriefViewCellRenderer extends JTextArea implements TableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
setText("-200");
}
}
JTable看起来不错,除了负数。减号在实际数字后面。
有谁知道如何解决它?