javax.swing.JScrollPane.addFocusListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中javax.swing.JScrollPane.addFocusListener()方法的一些代码示例,展示了JScrollPane.addFocusListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.addFocusListener()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:addFocusListener

JScrollPane.addFocusListener介绍

暂无

代码示例

代码示例来源:origin: senbox-org/snap-desktop

private void createCellDefaultValueList(FocusListener focusListener) {
  JList list = new JList();
  list.addFocusListener(focusListener);
  this.cellDefaultValueList = new JScrollPane(list);
  this.cellDefaultValueList.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  this.cellDefaultValueList.setBorder(new EmptyBorder(0, 0, 0, 0));
  this.cellDefaultValueList.setOpaque(true);
  this.cellDefaultValueList.setVisible(false);
  this.cellDefaultValueList.setBackground(Color.white);
  this.cellDefaultValueList.addFocusListener(new FocusAdapter() {
    @Override
    public void focusGained(FocusEvent event) {
      cellDefaultValueList.getViewport().getView().requestFocusInWindow();
    }
  });
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

$JScrollPane0.addFocusListener(JAXXUtil.getEventListener(FocusListener.class, "focusGained", this, "doFocusGained__on__$JScrollPane0"));
createUniverseList();
$JScrollPane1.addFocusListener(JAXXUtil.getEventListener(FocusListener.class, "focusGained", this, "doFocusGained__on__$JScrollPane1"));
createSelectedList();

相关文章

JScrollPane类方法