partTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {  public void valueChanged(ListSelectionEvent e) { if(!e.getValueIsAdjusting() && partTable.getSelectedRow() >= 0 && partTable.getSelectedColumn() == 0 && partTable.getSelectedRow() < getModel().size()) {
partTable.setPreferredScrollableViewportSize(new Dimension(100, (model.size()+1)*partTable.getRowHeight())); setViewportView(partTable); partTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { Point p = e.getPoint(); int row = partTable.rowAtPoint(p); if(partTable.columnAtPoint(p) == 0 && row >= 0 && row < model.size()) { removePart(row); } }  }); partTable.addKeyListener(new KeyAdapter(){ @Override public void keyPressed(KeyEvent e) { if(partTable.getSelectedColumn() == 0 && partTable.getSelectedRow() >= 0 && partTable.getSelectedRow() < model.size() && e.getKeyCode() == e.VK_ENTER) {
	public PartSetTranslationInput(PartSet model, String title) {		super();		this.model = model;		setBorder(BorderFactory.createTitledBorder(title));				partTable = new JTable(tableModel);		partTable.setDefaultRenderer(Icon.class, new IconRenderer());		partTable.setRowSelectionAllowed(false);		partTable.getColumnModel().getColumn(0).setPreferredWidth(removeIcon.getIconWidth());		partTable.getColumnModel().getColumn(1).setPreferredWidth(removeIcon.getIconWidth()+8);		partTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);		partTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {			public void valueChanged(ListSelectionEvent e) {				if(!e.getValueIsAdjusting()					&& partTable.getSelectedRow() >= 0					&& partTable.getSelectedColumn() == 0					&& partTable.getSelectedRow() < getModel().size()) {					removePart(partTable.getSelectedRow());				}			}				});		partTable.setPreferredScrollableViewportSize(new Dimension(100, (model.size()+1)*partTable.getRowHeight()));		setViewportView(partTable);		update();	}