@Override
						public void mouseReleased(MouseEvent e) {
							if (MouseEvent.BUTTON1 == e.getButton()) {
								JButton btemp = (JButton) e.getSource();
								Pair<JPanel, ArrayList<JComboBox>> pane;
								if (mapButtonCombo.containsKey(btemp)) {
									pane = mapButtonCombo.get(btemp);
								} else {
									pane = np.getOptionPane(mapButtonNary
											.get(btemp));
									mapButtonCombo.put(btemp, pane);
								}

								boolean check = true;
								while (check) {
									int result = JOptionPane.showConfirmDialog(
											null, pane.getFirst(),
											"Specify the order",
											JOptionPane.OK_CANCEL_OPTION);
									if (result == JOptionPane.CANCEL_OPTION) {
										check = false;
									} else {
										if (result == JOptionPane.OK_OPTION) {
											// check if the choices are
											// different
											List<String> newOrder = new ArrayList<String>();
											List<JComboBox> temp2 = pane
													.getSecond();
											for (int i = 0; i < temp2.size(); i++) {
												String s = temp2.get(i)
														.getSelectedItem()
														.toString();
												newOrder.add(s);
											}
											HashSet<String> hashSet = new HashSet<String>();
											check = false;
											for (String s : newOrder) {
												if (hashSet.contains(s))
													check = true; // contains
																	// duplicates
												else
													hashSet.add(s);
											}
											if (check) {
												JOptionPane.showMessageDialog(
														pane.getFirst(),
														"Duplicate(s) detected! Choose the correct order!",
														"ERROR",
														JOptionPane.ERROR_MESSAGE);
											} else {
												JLabel l = mapButtonLabel
														.get(btemp);
												l.setText(""); // remove the
																// current text
												for (int i = 0; i < newOrder
														.size(); i++) {
													l.setText(l.getText()
															+ newOrder.get(i)
															+ " ");
												}
												mapButtonNary.put(btemp,
														newOrder);
												String reltemp = mapButtonRelationName
														.get(btemp);
												nary.put(reltemp, newOrder);
											}
										}
									}
								}
							}
						}