< prev index next >

test/java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25 @test
  26 @bug 8068283
  27 @summary Checks that <Alt>+Char accelerators work when pressed in a text component
  28 @author Anton Nashatyrev

  29 @run main AltCharAcceleratorTest
  30 */
  31 
  32 import javax.swing.*;
  33 import java.awt.*;
  34 import java.awt.event.*;
  35 import java.util.concurrent.CountDownLatch;
  36 import java.util.concurrent.TimeUnit;
  37 
  38 public class AltCharAcceleratorTest {
  39 
  40     boolean action1 = false;
  41     boolean action2 = false;
  42 
  43     CountDownLatch focusLatch = new CountDownLatch(1);
  44     CountDownLatch actionLatch = new CountDownLatch(2);
  45 
  46     public AltCharAcceleratorTest() throws Exception {
  47         SwingUtilities.invokeAndWait(new Runnable() {
  48             @Override




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25 @test
  26 @bug 8068283
  27 @summary Checks that <Alt>+Char accelerators work when pressed in a text component
  28 @author Anton Nashatyrev
  29 @modules java.desktop/sun.awt
  30 @run main AltCharAcceleratorTest
  31 */
  32 
  33 import javax.swing.*;
  34 import java.awt.*;
  35 import java.awt.event.*;
  36 import java.util.concurrent.CountDownLatch;
  37 import java.util.concurrent.TimeUnit;
  38 
  39 public class AltCharAcceleratorTest {
  40 
  41     boolean action1 = false;
  42     boolean action2 = false;
  43 
  44     CountDownLatch focusLatch = new CountDownLatch(1);
  45     CountDownLatch actionLatch = new CountDownLatch(2);
  46 
  47     public AltCharAcceleratorTest() throws Exception {
  48         SwingUtilities.invokeAndWait(new Runnable() {
  49             @Override


< prev index next >