本文整理汇总了Java中javax.swing.JScrollPane.setFocusable方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollPane.setFocusable方法的具体用法?Java JScrollPane.setFocusable怎么用?Java JScrollPane.setFocusable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.setFocusable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FileCompletionPopup
import javax.swing.JScrollPane; //导入方法依赖的package包/类
public FileCompletionPopup(JFileChooser chooser, JTextField textField, Vector<File> files) {
this.list = new JList(files);
this.textField = textField;
this.chooser = chooser;
list.setVisibleRowCount(4);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane jsp = new JScrollPane(list);
add(jsp);
list.setFocusable(false);
jsp.setFocusable(false);
setFocusable(false);
list.addFocusListener(new FocusHandler());
list.addMouseListener(new MouseHandler());
list.addMouseMotionListener(new MouseHandler());
textField.addKeyListener(this);
}
示例2: CompletionPopup
import javax.swing.JScrollPane; //导入方法依赖的package包/类
public CompletionPopup(Completable completable) {
this.list = new JList();
enabledColor = list.getForeground();
list.setVisibleRowCount(4);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
this.completable = completable;
JScrollPane jsp = new JScrollPane(list);
add(jsp);
list.setFocusable(false);
jsp.setFocusable(false);
setFocusable(false);
list.addFocusListener(new FocusHandler());
list.addMouseListener(new MouseHandler());
list.addMouseMotionListener(new MouseHandler());
completable.addKeyListener(CompletionPopup.this);
}