当前位置: 首页>>代码示例>>Java>>正文


Java JXList.addMouseListener方法代码示例

本文整理汇总了Java中org.jdesktop.swingx.JXList.addMouseListener方法的典型用法代码示例。如果您正苦于以下问题:Java JXList.addMouseListener方法的具体用法?Java JXList.addMouseListener怎么用?Java JXList.addMouseListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.swingx.JXList的用法示例。


在下文中一共展示了JXList.addMouseListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addAllPanel

import org.jdesktop.swingx.JXList; //导入方法依赖的package包/类
private void addAllPanel(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);

    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });

    tabs.addTab(PhoneRes.getIString("phone.all"), null, new JScrollPane(list), PhoneRes.getIString("phone.allcalls"));
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:18,代码来源:CallHistoryUI.java

示例2: addDialedCalls

import org.jdesktop.swingx.JXList; //导入方法依赖的package包/类
private void addDialedCalls(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);
    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });
    List<RowFilter<Object,Object>> filters = new ArrayList<RowFilter<Object,Object>>();
    filters.add(RowFilter.regexFilter(CallLog.Type.dialed.toString(), 1));
    filters.add(RowFilter.regexFilter(CallLog.Type.dialed.toString(), 2));
    filters.add(RowFilter.regexFilter(CallLog.Type.dialed.toString(), 3));
    RowFilter<Object,Object> af = RowFilter.orFilter(filters);
    list.setRowFilter(af);           

    tabs.addTab(PhoneRes.getIString("phone.dialed"), null, new JScrollPane(list), PhoneRes.getIString("phone.dialedcalls"));
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:23,代码来源:CallHistoryUI.java

示例3: addCallsReceived

import org.jdesktop.swingx.JXList; //导入方法依赖的package包/类
private void addCallsReceived(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);
    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });

    List<RowFilter<Object,Object>> filters = new ArrayList<RowFilter<Object,Object>>();
    filters.add(RowFilter.regexFilter(CallLog.Type.received.toString(), 1));
    filters.add(RowFilter.regexFilter(CallLog.Type.received.toString(), 2));
    filters.add(RowFilter.regexFilter(CallLog.Type.received.toString(), 3));
    RowFilter<Object,Object> af = RowFilter.orFilter(filters);
    list.setRowFilter(af);

    tabs.addTab(PhoneRes.getIString("phone.received"), null, new JScrollPane(list), PhoneRes.getIString("phone.receivedcalls"));
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:24,代码来源:CallHistoryUI.java

示例4: addCallsMissed

import org.jdesktop.swingx.JXList; //导入方法依赖的package包/类
private void addCallsMissed(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);
    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });

    List<RowFilter<Object,Object>> filters = new ArrayList<RowFilter<Object,Object>>();
    filters.add(RowFilter.regexFilter(CallLog.Type.missed.toString(), 1));
    filters.add(RowFilter.regexFilter(CallLog.Type.missed.toString(), 2));
    filters.add(RowFilter.regexFilter(CallLog.Type.missed.toString(), 3));
    RowFilter<Object,Object> af = RowFilter.orFilter(filters);
    list.setRowFilter(af);

    tabs.addTab(PhoneRes.getIString("phone.missed"), null, new JScrollPane(list), PhoneRes.getIString("phone.missedcalls"));
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:24,代码来源:CallHistoryUI.java

示例5: initUI

import org.jdesktop.swingx.JXList; //导入方法依赖的package包/类
private void initUI() {
	final ImageIcon icon = IconCache.getInstance().getIcon("msg", 16);
	
	dataModel = new DefaultListModel<FIXMessageListItem>();
	jList = new JXList(dataModel);
	jList.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			if (e.isPopupTrigger()) {
			}
		}
	});
	jList.setCellRenderer(new DefaultListCellRenderer() {
		private static final long serialVersionUID = 1L;

		@Override
		public Component getListCellRendererComponent(JList<?> list,
				Object value, int index, boolean isSelected,
				boolean cellHasFocus) {
			super.getListCellRendererComponent(list, value, index, isSelected,
					cellHasFocus);
			setIcon(icon);
			return this;
		}
	});

	JScrollPane scrollPane = new JScrollPane(jList,
			JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
			JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

	JToolBar toolBar = new JToolBar();
	toolBar.add(new ClearAction());
	toolBar.add(new LoadMessageFileAction());
	toolBar.setFloatable(false);

	setLayout(new BorderLayout(5, 5));
	add(toolBar, BorderLayout.NORTH);
	add(scrollPane);
}
 
开发者ID:RockManJoe64,项目名称:fixprotocol-test-suite,代码行数:40,代码来源:FIXMessageListPanel.java


注:本文中的org.jdesktop.swingx.JXList.addMouseListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。