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


Java AWTException.getMessage方法代碼示例

本文整理匯總了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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:18,代碼來源:ActionEventTest.java

示例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();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:23,代碼來源:ItemEventTest.java

示例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.");
            }
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:42,代碼來源:ActionEventTest.java


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