本文整理匯總了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.");
}
}
});
}