I have a Java application, and I need an user-friendly component for entering a lot of pairs easily, I think the most friendly way to do it is make a table, somewhat like a spreadsheet and let them edit that manually, but i'm not sure what listeners to use for that, and it seems rather complicated, what I want to know is if there is a nicer component for that task.
I would use a JTable. You can write a class which extends AbstractTableModel to handle display, validation, etc. It handles most of the work for you. You just need to override the few methods you care about. The Java tutorial on Tables has a pretty good overview, but pretty much all you need to do to make your cells editable is have isCellEditable() return true and implement an appropriate setValueAt() function.