randomMapDialog.setMapSettings(mapSettings);
    private void apply() {        int boardWidth;        int boardHeight;        int mapWidth;        int mapHeight;                // read map size settings        try {            boardWidth = Integer.parseInt(texBoardWidth.getText());            boardHeight = Integer.parseInt(texBoardHeight.getText());            mapWidth = Integer.parseInt(texMapWidth.getText());            mapHeight = Integer.parseInt(texMapHeight.getText());        } catch (NumberFormatException ex) {            new AlertDialog(client.frame, "Invalid Map Size", "Invalid number in map size settings.").show();            return;        }                // check settings        if (boardHeight <= 0 || boardHeight <= 0 || mapWidth <= 0 || mapHeight <= 0) {            new AlertDialog(client.frame, "Invalid Map Size", "All map size settings must be greater than 0.").show();            return;        }                butOkay.setEnabled(false);                mapSettings.setBoardSize(boardWidth, boardHeight);        mapSettings.setMapSize(mapWidth, mapHeight);                refreshMapSize();        refreshMapButtons();                lisBoardsSelected.removeAll();        lisBoardsSelected.add("Updating...");                lisBoardsAvailable.removeAll();        lisBoardsAvailable.add("Updating...");                client.sendMapQuery(mapSettings);    }