java.awt.AWTException#printStackTrace ( )源码实例Demo

下面列出了java.awt.AWTException#printStackTrace ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ExternalPlugins   文件: AutoPrayFlickPlugin.java
private void simLeftClick()
{
	if (config.mouseEvents())
	{
		extUtils.click(bounds);
		return;
	}

	try
	{
		Robot leftClk = new Robot();
		leftClk.mousePress(BUTTON1_DOWN_MASK);
		leftClk.mouseRelease(BUTTON1_DOWN_MASK);
	}
	catch (AWTException e)
	{
		e.printStackTrace();
	}
}
 
源代码2 项目: nanoleaf-desktop   文件: AmbilightHandler.java
public AmbilightHandler(Aurora[] auroras,
                        PanelCanvas canvas, AmbilightPanel parent) {
    this.auroras = auroras;
    this.canvas = canvas;
    this.parent = parent;
    delay = parent.getUpdateDelay();
    transTime = parent.getTransitionTime();
    brightness = parent.getBrightness();
    captureArea = parent.getCaptureArea();
    mode = parent.getMode();

    try {
        robot = new Robot();
    } catch (AWTException awte) {
        awte.printStackTrace();
    }
}
 
源代码3 项目: SikuliX1   文件: Guide.java
private void init(Region region) {
  try {
    robot = new Robot();
  } catch (AWTException e1) {
    e1.printStackTrace();
  }
  content = getJPanel();
  _region = region;
  Rectangle rect = _region.getRect();
  content.setPreferredSize(rect.getSize());
  add(content);
  setBounds(rect);
  getRootPane().putClientProperty("Window.shadow", Boolean.FALSE);
  ((JPanel) getContentPane()).setDoubleBuffered(true);
  setVisible(false);
  setFocusableWindowState(false);
}
 
protected void firstFrame() {
	Demo_SpeechRecognitionCopypasta thiss = this;
	java.awt.EventQueue.invokeLater(new Runnable() {
		public void run() {
			frame = new FrameWithBorderLayout();
			frame.initWithDelegate(thiss);
			frame.setVisible(false);
		}
	});
	
	try {
		robot = new Robot();
	} catch (AWTException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码6 项目: karamel   文件: TrayUI.java
private void createGui() {

    setJPopupMenu(createJPopupMenu());
    try {
            // TODO: Bug in setting transparency of SystemTray Icon in 
      // Linux - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6453521
      SystemTray.getSystemTray().add(this);
    } catch (AWTException e) {
      e.printStackTrace();
    }
  }
 
源代码7 项目: openjdk-jdk9   文件: PopupMenuLeakTest.java
private static void createSystemTrayIcon() {
    final TrayIcon trayIcon = new TrayIcon(createTrayIconImage());
    trayIcon.setImageAutoSize(true);

    try {
        // Add tray icon to system tray *before* adding popup menu to demonstrate buggy behaviour
        trayIcon.setPopupMenu(createTrayIconPopupMenu());
        SystemTray.getSystemTray().add(trayIcon);
        iconWeakReference.set(new WeakReference<>(trayIcon));
        popupWeakReference.set(new WeakReference<>(trayIcon.getPopupMenu()));
    } catch (final AWTException awte) {
        awte.printStackTrace();
    }
}
 
源代码8 项目: jdk8u-jdk   文件: VSyncedBufferStrategyTest.java
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码9 项目: openjdk-jdk8u   文件: VSyncedBufferStrategyTest.java
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码10 项目: jdk8u-jdk   文件: VSyncedBufferStrategyTest.java
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码11 项目: openjdk-jdk9   文件: VSyncedBufferStrategyTest.java
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码12 项目: jdk8u-dev-jdk   文件: VSyncedBufferStrategyTest.java
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码13 项目: phoenix.webui.framework   文件: AwtMouse.java
@Override
public void click()
{
	try
	{
		Robot robot = new Robot();
		robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
		robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
	}
	catch (AWTException e)
	{
		e.printStackTrace();
	}
}
 
源代码14 项目: marathonv5   文件: JavaAgent.java
@Override
public byte[] getScreenShot() throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
        BufferedImage bufferedImage;
        Dimension windowSize = Toolkit.getDefaultToolkit().getScreenSize();
        bufferedImage = new Robot().createScreenCapture(new Rectangle(0, 0, windowSize.width, windowSize.height));
        ImageIO.write(bufferedImage, "png", baos);
    } catch (AWTException e) {
        e.printStackTrace();
    }
    return baos.toByteArray();
}
 
源代码15 项目: marathonv5   文件: RobotDevice.java
public RobotDevice() {
    try {
        this.robot = new Robot();
        robotXsetAutoWaitForIdle(true);
        robotXsetAutoDelay();
    } catch (AWTException e) {
        e.printStackTrace();
    }
}
 
源代码16 项目: hottub   文件: VSyncedBufferStrategyTest.java
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码17 项目: PengueeBot   文件: Screen.java
public Screen() {
	cache = new HashMap<Frag, Position>();
	try {
		robot = new Robot();
	} catch (AWTException e) {
		e.printStackTrace();
	}
}
 
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
private void createBS(boolean requestVSync) {
    if (bs != null && requestVSync == currentBSVSynced) {
        return;
    }

    BufferCapabilities bc = defaultBC;
    if (requestVSync) {
        bc = new sun.java2d.pipe.hw.ExtendedBufferCapabilities(
                new ImageCapabilities(true),
                new ImageCapabilities(true),
                FlipContents.COPIED,
                sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON);
    }
    try {
        createBufferStrategy(2, bc);
    } catch (AWTException e) {
        System.err.println("Warning: cap is not supported: "+bc);
        e.printStackTrace();
        createBufferStrategy(2);
    }
    currentBSVSynced = requestVSync;
    bs = getBufferStrategy();
    String s =
        getParent() instanceof Frame ?
            ((Frame)getParent()).getTitle() : "parent";
    System.out.println("Created BS for \"" + s + "\" frame, bs="+bs);
}
 
源代码20 项目: ramus   文件: Manager.java
private void start(String[] args) {
    SystemTray tray = SystemTray.getSystemTray();
    TrayIcon icon = new TrayIcon(Toolkit.getDefaultToolkit().createImage(
            getClass().getResource(
                    "/com/ramussoft/gui/server/application.png")),
            getString("Server") + " " + Metadata.getApplicationName(),
            createPopupMenu());
    icon.setImageAutoSize(true);
    try {
        tray.add(icon);
    } catch (AWTException e) {
        e.printStackTrace();
    }
}
 
 方法所在类
 同类方法