< prev index next >

test/javax/swing/JComboBox/8015300/Test8015300.java

Print this page
rev 14031 : 8160974: [TESTBUG] Mark more headful tests with @key headful.

This is a backport of fe58d505fffd from jdk9. 228/596 hunks apply without
modifications. 16 hunks required manual rework. The remainder were for files
not present in jdk8u.


  21  * questions.
  22  */
  23 
  24 import com.sun.java.swing.plaf.windows.WindowsComboBoxUI.WindowsComboBoxEditor;
  25 import java.awt.Toolkit;
  26 import java.awt.event.ItemEvent;
  27 import java.awt.event.ItemListener;
  28 import javax.swing.ComboBoxEditor;
  29 import javax.swing.JComboBox;
  30 import javax.swing.JFrame;
  31 import javax.swing.JTextField;
  32 import javax.swing.UIManager;
  33 import sun.awt.SunToolkit;
  34 
  35 import static javax.swing.SwingUtilities.invokeAndWait;
  36 import static javax.swing.SwingUtilities.windowForComponent;
  37 import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
  38 
  39 /*
  40  * @test

  41  * @bug 8015300
  42  * @summary Tests that editable combobox select all text
  43  * @author Sergey Malenkov
  44  */
  45 
  46 public class Test8015300 {
  47     private static final SunToolkit STK = (SunToolkit) Toolkit.getDefaultToolkit();
  48     private static final String[] ITEMS = {
  49             "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
  50             "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
  51 
  52     private static JComboBox<String> combo;
  53 
  54     public static void main(String[] args) throws Exception {
  55         UIManager.LookAndFeelInfo[] array = UIManager.getInstalledLookAndFeels();
  56         for (UIManager.LookAndFeelInfo info : array) {
  57             UIManager.setLookAndFeel(info.getClassName());
  58             System.err.println("L&F: " + info.getName());
  59             invokeAndWait(new Runnable() {
  60                 @Override
  61                 public void run() {
  62                     combo = new JComboBox<>(ITEMS);




  21  * questions.
  22  */
  23 
  24 import com.sun.java.swing.plaf.windows.WindowsComboBoxUI.WindowsComboBoxEditor;
  25 import java.awt.Toolkit;
  26 import java.awt.event.ItemEvent;
  27 import java.awt.event.ItemListener;
  28 import javax.swing.ComboBoxEditor;
  29 import javax.swing.JComboBox;
  30 import javax.swing.JFrame;
  31 import javax.swing.JTextField;
  32 import javax.swing.UIManager;
  33 import sun.awt.SunToolkit;
  34 
  35 import static javax.swing.SwingUtilities.invokeAndWait;
  36 import static javax.swing.SwingUtilities.windowForComponent;
  37 import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
  38 
  39 /*
  40  * @test
  41  * @key headful
  42  * @bug 8015300
  43  * @summary Tests that editable combobox selects all text.
  44  * @author Sergey Malenkov
  45  */
  46 
  47 public class Test8015300 {
  48     private static final SunToolkit STK = (SunToolkit) Toolkit.getDefaultToolkit();
  49     private static final String[] ITEMS = {
  50             "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
  51             "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
  52 
  53     private static JComboBox<String> combo;
  54 
  55     public static void main(String[] args) throws Exception {
  56         UIManager.LookAndFeelInfo[] array = UIManager.getInstalledLookAndFeels();
  57         for (UIManager.LookAndFeelInfo info : array) {
  58             UIManager.setLookAndFeel(info.getClassName());
  59             System.err.println("L&F: " + info.getName());
  60             invokeAndWait(new Runnable() {
  61                 @Override
  62                 public void run() {
  63                     combo = new JComboBox<>(ITEMS);


< prev index next >