Hi, Actually, getAttrib() will return a Map, not only 2 strings(key, value).
But with the code that you gave it here, you can do like this: TestHashMap thm = new TestHashMap(); thm.addAttrib("1", "test1"); thm.addAttrib("2", "test2"); Map<String, String> m = thm.getAttrib(); System.out.println(m.keySet()); System.out.println(m.values()); and you can iterate through m.keySet() and m.values() in order to arrange the data in the way you want. Hope that this is what you wanted to do, if not give a reply:) Regards, Georgiana 2010/12/2 Rafał Laczek <rafal_lac...@wp.pl> > Hi Colleagues, > > I have HashMap. > I have also method getAttrib() which returns 2 strings (key, value). > I must in any way divide these data and get key and value in 2 separate > strings (for example lists). > In my application I must display them in to seperate columns. > > I look for in internet but can't find solution. > Below I give some code. (This is not my code). > Thanks for any help! > > Regards, > > Rafal > > > > private Map<String, String> attrib = new HashMap<String, String>(); > > public Map<String, String> getAttrib() { > return attributes; > } > public void addAttrib(String key, String value) { > this.attributes.put(key, value); > } > > > -- > You received this message because you are subscribed to the Google > Groups "Java EE (J2EE) Programming with Passion!" group. > To post to this group, send email to > java-ee-j2ee-programming-with-passion@googlegroups.com > To unsubscribe from this group, send email to > java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com<java-ee-j2ee-programming-with-passion%2bunsubscr...@googlegroups.com> > For more options, visit this group at > > http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -- You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en