// Sorts labels from the mapping. We may get rid of this later perhaps. String[] revisedLabels(HashMap map) { // Sort labels String[] labels = new String[map.size()]; labels = (String[]) (map.keySet().toArray(labels)); Arrays.sort(labels); return labels; }