Skip to content

Commit 6d374ec

Browse files
hansonrhansonr
authored andcommitted
AWT/Swing List - working; not functional
1 parent c818617 commit 6d374ec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sources/net.sf.j2s.java.core/src/swingjs/a2s/List.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public void add(String item, int index) {
167167
*/
168168
@Deprecated
169169
public synchronized void addItem(String item, int index) {
170-
if (index < 0 || index >= awtmodel.getSize())
170+
if (index >= 0 && index < awtmodel.getSize())
171171
awtmodel.add(index, item);
172172
else
173173
awtmodel.addElement(item);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ protected void paintCell(Graphics g, int index, Rectangle rowBounds,
309309
/**
310310
* @j2sNative
311311
*
312-
* if (!rendererComponent.getUI) { alert(
312+
* if (!rendererComponent.getUI$) { alert(
313313
* "swingjs.JListUI -- Developer! All list cell renderers in SwingJS must be Swing components"
314314
* ); }
315315
*

0 commit comments

Comments
 (0)