本文整理匯總了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);
}