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


Java TooManyListenersException.printStackTrace方法代码示例

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


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

示例1: configureGlassLayer

import java.util.TooManyListenersException; //导入方法依赖的package包/类
private void configureGlassLayer() {
    try {
        glassLayer.setDropTarget(new DropTarget());
        glassLayer.getDropTarget().addDropTargetListener(new GlassLayerDropTargetListener());
    } catch (TooManyListenersException ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:MenuEditLayer.java

示例2: exportAsDrag

import java.util.TooManyListenersException; //导入方法依赖的package包/类
@Override
public void exportAsDrag(JComponent comp, InputEvent e, int action) {
	int srcActions = getSourceActions(comp);

	// only mouse events supported for drag operations
	if (!(e instanceof MouseEvent)
	// only support known actions
			|| !(action == COPY || action == MOVE || action == LINK)
			// only support valid source actions
			|| (srcActions & action) == 0) {

		action = NONE;
	}

	if (action != NONE && !GraphicsEnvironment.isHeadless()) {
		if (recognizer == null) {
			recognizer = new SwingDragGestureRecognizer();

		}
		DragHandler dgl = new DragHandler();
		try {
			recognizer.addDragGestureListener(dgl);
		} catch (TooManyListenersException e1) {
			e1.printStackTrace();
		}
		recognizer.gestured(comp, (MouseEvent) e, srcActions, action);
		recognizer.removeDragGestureListener(dgl);
	} else {
		exportDone(comp, null, NONE);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:32,代码来源:AbstractPatchedTransferHandler.java

示例3: makeDropTarget

import java.util.TooManyListenersException; //导入方法依赖的package包/类
private void makeDropTarget( final PrintStream out, final Component c, boolean recursive )
{
    // Make drop target
    final DropTarget dt = new DropTarget();
    try
    {   dt.addDropTargetListener( dropListener );
    }   // end try
    catch(TooManyListenersException e )
    {   e.printStackTrace();
        log(out, "FileDrop: Drop will not work due to previous error. Do you have another listener attached?" );
    }   // end catch
    // Listen for hierarchy changes and remove the drop target when the parent gets cleared out.
    c.addHierarchyListener( new HierarchyListener()
    {   public void hierarchyChanged( HierarchyEvent evt )
        {   log( out, "FileDrop: Hierarchy changed." );
            Component parent = c.getParent();
            if( parent == null )
            {   c.setDropTarget( null );
                log( out, "FileDrop: Drop target cleared from component." );
            }   // end if: null parent
            else
            {   
                new DropTarget(c, dropListener);
                log( out, "FileDrop: Drop target added to component." );
            }   // end else: parent not null
        }   // end hierarchyChanged
    }); // end hierarchy listener
    if( c.getParent() != null )
        new DropTarget(c, dropListener);
    if( recursive && (c instanceof Container ) )
    {   
        // Get the container
        Container cont = (Container) c;
        // Get it's components
        Component[] comps = cont.getComponents();
        // Set it's components as listeners also
        for( int i = 0; i < comps.length; i++ )
            makeDropTarget( out, comps[i], recursive );
    }   // end if: recursively set components as listener
}
 
开发者ID:kounelios13,项目名称:File-Copy-Manager,代码行数:41,代码来源:FileDrop.java

示例4: TextureGraphEditorPanel

import java.util.TooManyListenersException; //导入方法依赖的package包/类
public TextureGraphEditorPanel() {
	graph = new TextureGraph();
	graph.graphListener = this;
	
	setBackground(Color.darkGray);
	setLayout(null);

	addMouseListener(this);
	addMouseWheelListener(this);
	addMouseMotionListener(this);

	createPopupMenus();
	paramEditorPanel = new ChannelParameterEditorPanel();
	
	DropTarget t = new DropTarget();
	try {
		t.addDropTargetListener(new TextureGraphDropTarget());
	} catch (TooManyListenersException e) {
		e.printStackTrace();
	}
	setDropTarget(t);
	
	setPreferredSize(new Dimension(512, 512));
	
	
	
}
 
开发者ID:Erkaman,项目名称:NeoTextureEdit2,代码行数:28,代码来源:TextureGraphEditorPanel.java

示例5: addListener

import java.util.TooManyListenersException; //导入方法依赖的package包/类
public void addListener(SerialPortEventListener serialPortEventListener) {
    try {
        serialPort.addEventListener(serialPortEventListener);
        serialPort.notifyOnDataAvailable(true);
    } catch (TooManyListenersException e) {
        e.printStackTrace();
    }
}
 
开发者ID:hatboysam,项目名称:muse-x,代码行数:9,代码来源:ArduinoConnection.java

示例6: makeDropTarget

import java.util.TooManyListenersException; //导入方法依赖的package包/类
private void makeDropTarget(final PrintStream out, final Component c,
	boolean recursive) {

	final DropTarget dt = new DropTarget();
	try {
		dt.addDropTargetListener(dropListener);
	} catch (TooManyListenersException e) {
		e.printStackTrace();
		log(out, "FileDrop: Drop will not work due to previous error. Do you have another listener attached?");
	}

	c.addHierarchyListener(new HierarchyListener() {
		public void hierarchyChanged(HierarchyEvent evt) {
			log(out, "FileDrop: Hierarchy changed.");
			Component parent = c.getParent();
			if (parent == null) {
				c.setDropTarget(null);
				log(out, "FileDrop: Drop target cleared from component.");
			} else {
				new DropTarget(c, dropListener);
				log(out, "FileDrop: Drop target added to component.");
			}
		}
	});
	if (c.getParent() != null)
		new DropTarget(c, dropListener);

	if (recursive && (c instanceof Container)) {

		Container cont = (Container) c;

		Component[] comps = cont.getComponents();

		for (int i = 0; i < comps.length; i++)
			makeDropTarget(out, comps[i], recursive);
	}
}
 
开发者ID:sing-group,项目名称:GC4S,代码行数:38,代码来源:FileDrop.java


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