swing - Java - jList sometimes not updating correctly? -
this code:
defaultlistmodel modelplayers = (defaultlistmodel)game.window.jlistplayers.getmodel(); defaultlistmodel modelplayersgame = (defaultlistmodel)game.window.jlistplayersingame.getmodel(); modelplayers.clear(); modelplayersgame.clear(); for(string s : getplayersfromarray(p.content[0])) { modelplayers.addelement(s); modelplayersgame.addelement(s); } private string[] getplayersfromarray(string array) { return array.split(","); }
sometimes content of list disappears , appears again (after update).
i have checked p.content[0]
contained player1, player2
should not problem.
Comments
Post a Comment