本文整理汇总了Java中java.awt.AWTException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java AWTException.getMessage方法的具体用法?Java AWTException.getMessage怎么用?Java AWTException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.AWTException
的用法示例。
在下文中一共展示了AWTException.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ActionEventTest
import java.awt.AWTException; //导入方法依赖的package包/类
public ActionEventTest() {
try {
robot = new Robot();
robot.setAutoDelay(100);
robot.setAutoWaitForIdle(true);
} catch(AWTException e) {
throw new RuntimeException(e.getMessage());
}
list = new List(1, false);
list.add("0");
add(list);
setSize(400,400);
setLayout(new FlowLayout());
pack();
setVisible(true);
}
示例2: ItemEventTest
import java.awt.AWTException; //导入方法依赖的package包/类
public ItemEventTest()
{
try {
robot = new Robot();
} catch(AWTException e) {
throw new RuntimeException(e.getMessage());
}
expectedSelectionOrder = "01230123";
list = new List(4, true);
list.add("0");
list.add("1");
list.add("2");
list.add("3");
add(list);
setSize(400,400);
setLayout(new FlowLayout());
pack();
setVisible(true);
robot.waitForIdle();
}
示例3: ActionEventTest
import java.awt.AWTException; //导入方法依赖的package包/类
public ActionEventTest() {
try {
robot = new Robot();
} catch(AWTException e) {
throw new RuntimeException(e.getMessage());
}
button = new Button("ClickMe");
button.setEnabled(true);
instructions = new TextArea(10, 50);
instructions.setText(
" This is a manual test\n" +
" Keep the Alt, Shift & Ctrl Keys pressed &\n" +
" Click 'ClickMe' button with left mouse button\n" +
" Test exits automatically after mouse click.");
add(button);
add(instructions);
setSize(400,400);
setLayout(new FlowLayout());
pack();
setVisible(true);
robot.waitForIdle();
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
int md = ae.getModifiers();
int expectedMask = ActionEvent.ALT_MASK | ActionEvent.CTRL_MASK
| ActionEvent.SHIFT_MASK;
isProgInterruption = true;
mainThread.interrupt();
if ((md & expectedMask) != expectedMask) {
throw new RuntimeException("Action Event modifiers"
+ " are not set correctly.");
}
}
});
}