0

I have a Java Swing app that I'm writing, that connects to my minecraft server and acts as administrative aid. It has a JList object in one of its panes that keeps track of which players are online. This is how I update the list:

public static void updatePlayerList(HashMap<String,String> players){
    playerListModel.clear(); //this is a DefaultListModel
    playerListModel.setSize(players.size());
    Object[] playerArray = players.keySet().toArray();
    for(int i = 0; i<players.size(); i++){
        playerListModel.set(i, playerArray[i]);
    }

This works fine and dandy and I personally have zero issue with it on my PC. However, two of my moderators are having issues with it forcing focus, even away from other applications.

I'd prefer that it didnt force focus from other applications, Is there any way to prevent this JList from doing that?

4

0 回答 0