Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java.awt.Robot():AWTException

9 views
Skip to first unread message

Slava Pikarevskij-Ushakov

unread,
Oct 31, 2007, 10:57:49 AM10/31/07
to
Здpавствуй очень уважаемый All ...

sabj!
"if the platform configuration does not allow low-level input control"

а как можно ?

Существует ли такой "platform configuration" для работы робота?

"Note that some platforms require special privileges or extensions to access
low-level input control. If the current platform configuration does not allow
input control, an AWTException will be thrown when trying to construct Robot
objects. For example, X-Window systems will throw the exception if the XTEST
2.2 standard extension is not supported (or not enabled) by the X server. "

у меня вин98/Ява sdk 1.4

Alexander Zuev

unread,
Nov 24, 2007, 2:58:52 PM11/24/07
to
Wed Oct 31 2007 17:57, Slava Pikarevskij-Ushakov wrote to All:

SPU> Здpавствуй очень уважаемый All ...

SPU> sabj!
SPU> "if the platform configuration does not allow low-level input control"

SPU> а как можно ?

SPU> Существует ли такой "platform configuration" для работы робота?

SPU> "Note that some platforms require special privileges or extensions to
SPU> access low-level input control. If the current platform configuration
SPU> does not allow input control, an AWTException will be thrown when trying
SPU> to construct Robot objects. For example, X-Window systems will throw the
SPU> exception if the XTEST 2.2 standard extension is not supported (or not
SPU> enabled) by the X server. "

SPU> у меня вин98/Ява sdk 1.4

Код в студию! Есть у меня подозоение что ты пытаешься это дело из апплета
запользовать :)

With best regards, Alexander Zuev.

Slava Pikarevskij-Ushakov

unread,
Dec 4, 2007, 4:44:08 AM12/4/07
to
Здpавствуй Alexander ...

SPU>> sabj!
SPU>> "if the platform configuration does not allow low-level input
SPU>> control"

SPU>> у меня вин98/Ява sdk 1.4
AZ> Код в студию! Есть у меня подозоение что ты пытаешься это дело из
AZ> апплета запользовать :)

И в мыслях не было.
Hарушать принцип о невозможности зловредного кода, тем более в форме атлета.
Целью было автоматизация - эмулятор пользователя (макросы), на основе
кросс-платформенной технологии.

public class Butonoroboto {
public static Robot robot;
public Butonoroboto() {
try {
robot = new Robot();
} catch (AWTException e) {
e.printStackTrace();
robot = null;
}
robot.setAutoWaitForIdle(true);
robot.setAutoDelay(500);
}
public static void main(String s[]) {
kombButonoj(KeyEvent.VK_ALT,KeyEvent.VK_TAB);
}
public static void kombButonoj(int key0, int key1) {
robot.keyPress(key0);
robot.keyPress(key1);
robot.keyRelease(key1);
robot.keyRelease(key0);
}
}


Alexander Zuev

unread,
Dec 4, 2007, 8:58:57 AM12/4/07
to
Tue Dec 04 2007 12:44, Slava Pikarevskij-Ushakov wrote to Alexander Zuev:
SPU>>> sabj!
SPU>>> "if the platform configuration does not allow low-level input
SPU>>> control"
SPU>>> у меня вин98/Ява sdk 1.4
AZ>> Код в студию! Есть у меня подозоение что ты пытаешься это дело из
AZ>> апплета запользовать :)
SPU> И в мыслях не было.
SPU> Hарушать принцип о невозможности зловредного кода, тем более в форме
SPU> атлета.
SPU> Целью было автоматизация - эмулятор пользователя (макросы), на основе
SPU> кросс-платформенной технологии.

Угк, продолжим апроксимацию. А что печатает
System.out.println("isHeadless? : "+GraphicsEnvironment.isHeadless());
Если true то либо инсталляция JDK битая либо сконфигурена она как-то
крововато...

Eugene Smelik

unread,
Dec 4, 2007, 9:13:11 AM12/4/07
to
Hi, Slava.

SU> И в мыслях не было.
SU> Hарушать принцип о невозможности зловредного кода, тем более в форме
SU> атлета. Целью было автоматизация - эмулятор пользователя (макросы), на
SU> основе кросс-платформенной технологии.
Eсли убрать явный NullPointerException, то у меня работает (WinXP SP2/JRE
1.5.0_12).

0 new messages