Skip to content

Commit e2256a2

Browse files
committed
JTable boolean checkbox fix
1 parent a4148d3 commit e2256a2

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed
52 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200404075511
1+
20200404111034
52 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200404075511
1+
20200404111034
52 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2882,11 +2882,12 @@ protected void updateCellNode() {
28822882
break;
28832883
case SwingConstants.LEFT:
28842884
case SwingConstants.LEADING:
2885-
DOMNode.setStyles(actionNode, "left", "0px", "transform", "scale(0.75,0.75) translate(-5px,-20px)");
2885+
DOMNode.setStyles(actionNode, "left", "0px",
2886+
"top", "50%", "transform", "scale(0.75,0.75) translateX(-50%) translateY(-50%) translate(-10px,-10px)");
28862887
break;
28872888
case SwingConstants.CENTER:
2888-
DOMNode.setStyles(actionNode, "left", (width / 2) + "px", "transform",
2889-
"scale(0.75,0.75) translate(-15px,-15px)"); // admittedly, a hack
2889+
DOMNode.setStyles(actionNode, "left", "50%", "top", "50%", "transform",
2890+
"scale(0.75,0.75) translateX(-50%) translateY(-50%) translate(-10px,-10px)");// translate(-20px,-20px)"); // admittedly, a hack translate(-50%,-50%) does not work- still need the -10,-10
28902891
break;
28912892
}
28922893

sources/net.sf.j2s.java.core/src/test/components/TableDemo.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,17 @@ public TableDemo() {
106106
table.setUI(new BasicTableUI() {
107107
@Override
108108
public void paint(Graphics g, JComponent c) {
109-
try { throw new NullPointerException();}catch (Exception e) {e.printStackTrace();}
110-
System.err.println("TableDemoUI g.clip=" + g.getClipBounds());
109+
// try { throw new NullPointerException();}catch (Exception e) {e.printStackTrace();}
110+
// System.err.println("TableDemoUI g.clip=" + g.getClipBounds());
111111
super.paint(g, c);
112112

113113
}
114114

115115
});
116116

117117

118-
table.setRowHeight(40);
118+
table.setRowHeight(16);
119+
table.setRowMargin(1);
119120
table.setPreferredScrollableViewportSize(new Dimension(500, 300));
120121
table.setFillsViewportHeight(true);
121122

0 commit comments

Comments
 (0)