Browse Source

REPORT-138856 fix: 序号列为居中展示,不需要文字左间距了

fbp/master
lemon 2 months ago
parent
commit
eba7b25178
  1. 8
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

8
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -16,9 +16,11 @@ import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.AbstractTableModel;
@ -350,10 +352,12 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
private class CellRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (column == 0) {
setBackground(new Color(229, 229, 229));
setHorizontalAlignment(CENTER);
}
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
//居中文本不需要设置 borderInsets
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
return component;
}
}

Loading…
Cancel
Save