當前位置: 首頁>>代碼示例>>Java>>正文


Java AWTException.printStackTrace方法代碼示例

本文整理匯總了Java中java.awt.AWTException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java AWTException.printStackTrace方法的具體用法?Java AWTException.printStackTrace怎麽用?Java AWTException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.AWTException的用法示例。


在下文中一共展示了AWTException.printStackTrace方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void execute(@NotNull String pattern) {

  try {
    Robot r = new Robot();
    r.keyPress(157);
    r.keyPress(90);

    r.keyRelease(90);
    r.keyRelease(157);

  } catch (AWTException e) {
    e.printStackTrace();
  }
  SelectionUtil.selectNode(_context.getEditorContext(), _context.getNode());
  SelectionUtil.selectCell(_context.getEditorContext(), _context.getNode(), SelectionManager.FIRST_ERROR_CELL + "|" + SelectionManager.FOCUS_POLICY_CELL + "|" + SelectionManager.FIRST_EDITABLE_CELL + "|" + SelectionManager.FIRST_CELL);

}
 
開發者ID:vaclav,項目名稱:voicemenu,代碼行數:19,代碼來源:Timeout_TransformationMenu.java

示例2: execute

import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void execute(@NotNull String pattern) {

  try {
    Robot r = new Robot();
    r.keyPress(157);
    r.keyPress(90);

    r.keyRelease(90);
    r.keyRelease(157);

  } catch (AWTException e) {
    e.printStackTrace();
  }
  SelectionUtil.selectNode(_context.getEditorContext(), _context.getNode());
  SelectionUtil.selectCell(_context.getEditorContext(), _context.getNode(), SelectionManager.FIRST_ERROR_CELL + "|" + SelectionManager.FOCUS_POLICY_CELL + "|" + SelectionManager.FIRST_EDITABLE_CELL + "|" + SelectionManager.FIRST_CELL);
}
 
開發者ID:vaclav,項目名稱:voicemenu,代碼行數:18,代碼來源:WorkSpace_TransformationMenu.java

示例3: enter

import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void enter()
{
	try
	{
		Robot robot = new Robot();
		robot.keyPress(KeyEvent.VK_ENTER);
		robot.keyRelease(KeyEvent.VK_ENTER);
	}
	catch (AWTException e)
	{
		e.printStackTrace();
	}
}
 
開發者ID:LinuxSuRen,項目名稱:phoenix.webui.framework,代碼行數:15,代碼來源:AwtKeyboard.java

示例4: space

import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void space()
{
	try
	{
		Robot robot = new Robot();
		robot.keyPress(KeyEvent.VK_SPACE);
		robot.keyRelease(KeyEvent.VK_SPACE);
	}
	catch (AWTException e)
	{
		e.printStackTrace();
	}
}
 
開發者ID:LinuxSuRen,項目名稱:phoenix.webui.framework,代碼行數:15,代碼來源:AwtKeyboard.java

示例5: wheel

import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void wheel(int num)
{
	try
	{
		new Robot().mouseWheel(num);
	}
	catch (AWTException e)
	{
		e.printStackTrace();
	}
}
 
開發者ID:LinuxSuRen,項目名稱:phoenix.webui.framework,代碼行數:13,代碼來源:AwtMouse.java

示例6: click

import java.awt.AWTException; //導入方法依賴的package包/類
@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();
	}
}
 
開發者ID:LinuxSuRen,項目名稱:phoenix.webui.framework,代碼行數:15,代碼來源:AwtMouse.java

示例7: getScreenShot

import java.awt.AWTException; //導入方法依賴的package包/類
@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();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:13,代碼來源:JavaAgent.java

示例8: init

import java.awt.AWTException; //導入方法依賴的package包/類
public static void init(Window frame2, Canvas cnv) {
	Listener.canvas = cnv;
	Listener.framec = frame2;
	setup(cnv);
	setup(frame2);

	try {
		robot = new Robot();
	} catch (AWTException e) {
		e.printStackTrace();
	}
}
 
開發者ID:ZetzmannM,項目名稱:CGL,代碼行數:13,代碼來源:Listener.java

示例9: movemouse

import java.awt.AWTException; //導入方法依賴的package包/類
public static void movemouse(int x,int y){
	try {
		new Robot().mouseMove(x, y);
	} catch (AWTException e) {
		e.printStackTrace();
	}
}
 
開發者ID:vanyle,項目名稱:Explorium,代碼行數:8,代碼來源:Tools.java

示例10: mouseclick

import java.awt.AWTException; //導入方法依賴的package包/類
public static void mouseclick(){
	try {
		new Robot().mousePress(MouseEvent.BUTTON1);
	} catch (AWTException e) {
		e.printStackTrace();
	}
}
 
開發者ID:vanyle,項目名稱:Explorium,代碼行數:8,代碼來源:Tools.java

示例11: Screen

import java.awt.AWTException; //導入方法依賴的package包/類
Screen() {
	cache = new HashMap<Frag, MatrixPosition>();
	try {
		robot = new Robot();
	} catch (AWTException e) {
		e.printStackTrace();
	}
}
 
開發者ID:1Ridav,項目名稱:PengueeBot,代碼行數:9,代碼來源:Screen.java

示例12: Action

import java.awt.AWTException; //導入方法依賴的package包/類
public Action() {
	try {
		screen = Data.screenObject;
		bot = new Robot();
	} catch (AWTException e) {
		e.printStackTrace();
	}
}
 
開發者ID:1Ridav,項目名稱:PengueeBot,代碼行數:9,代碼來源:Action.java

示例13: start

import java.awt.AWTException; //導入方法依賴的package包/類
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();
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:15,代碼來源:Manager.java

示例14: createBS

import java.awt.AWTException; //導入方法依賴的package包/類
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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:28,代碼來源:VSyncedBufferStrategyTest.java

示例15: setup

import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void setup() {
	try {
           rob = new Robot();
       } catch (AWTException e) {
           e.printStackTrace();
       }
}
 
開發者ID:SlideKB,項目名稱:SlideBar,代碼行數:9,代碼來源:Scroller.java


注:本文中的java.awt.AWTException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。