因此,我认为我需要这个按钮作为一个ListSelectionListener,监听JTable的SelectionModel,就像这个中描述的那样。// Implementing this method to be a ListSelectionListener.
public void valueChanged(ListSelectionEvent但是我对Swing & OOP的理解是,ListSelectionListener的代码应该在侦听小部件本身(在我的例子中是JButton )中。解决方案:我将在JF
我已经创建了以下实现ListSelectionListener接口的类。这个类应该“监听”我创建的JList的选择事件。import java.util.List;
import javax.swing.event.ListSelectionListener;
public class FormatListSelectionListener implements ListSelectio