本文整理匯總了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);
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例5: wheel
import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void wheel(int num)
{
try
{
new Robot().mouseWheel(num);
}
catch (AWTException e)
{
e.printStackTrace();
}
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例10: mouseclick
import java.awt.AWTException; //導入方法依賴的package包/類
public static void mouseclick(){
try {
new Robot().mousePress(MouseEvent.BUTTON1);
} catch (AWTException e) {
e.printStackTrace();
}
}
示例11: Screen
import java.awt.AWTException; //導入方法依賴的package包/類
Screen() {
cache = new HashMap<Frag, MatrixPosition>();
try {
robot = new Robot();
} catch (AWTException e) {
e.printStackTrace();
}
}
示例12: Action
import java.awt.AWTException; //導入方法依賴的package包/類
public Action() {
try {
screen = Data.screenObject;
bot = new Robot();
} catch (AWTException e) {
e.printStackTrace();
}
}
示例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();
}
}
示例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);
}
示例15: setup
import java.awt.AWTException; //導入方法依賴的package包/類
@Override
public void setup() {
try {
rob = new Robot();
} catch (AWTException e) {
e.printStackTrace();
}
}