- private HashMap<String, Integer> theIPs = new HashMap<String, Integer>();
- public void grabIPS() {
- String[] textLines = text1.getText().split("\n");
- for (String textLine : textLines) {
- String s = textLine.substring(textLine.indexOf("IP ") + 3);
- s = s.substring(0, s.indexOf(" ")).trim();
- if (!theIPs.containsKey(s)) {
- theIPs.put(s, 1);
- } else {
- theIPs.put(s, theIPs.get(s) + 1);
- }
- }
- }