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 import java.awt.*;
24 import java.awt.event.*;
25
26 import javax.swing.*;
27
28 /**
29 * @test
30 * @bug 4515752 4337071
31 * @author Mark Davidson
32 * @summary Tests the invocation of the default button within the JComboBox.
33 */
34 public class DefaultButtonTest extends JFrame implements ActionListener {
35
36 private static boolean defaultButtonPressed = false;
37 private static boolean editChanged = false;
38
39 private static String[] strData = {
40 "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
41 };
42
43 private static String[] strData2 = {
44 "One", "Two", "Three", "Four", "Five", "Six", "Seven"
45 };
46
47 public static void main(String[] args) throws Throwable {
48 SwingUtilities.invokeAndWait(new Runnable(){
49 public void run() {
|
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 import java.awt.*;
24 import java.awt.event.*;
25
26 import javax.swing.*;
27
28 /**
29 * @test
30 * @key headful
31 * @bug 4515752 4337071
32 * @author Mark Davidson
33 * @summary Tests the invocation of the default button within the JComboBox.
34 */
35 public class DefaultButtonTest extends JFrame implements ActionListener {
36
37 private static boolean defaultButtonPressed = false;
38 private static boolean editChanged = false;
39
40 private static String[] strData = {
41 "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
42 };
43
44 private static String[] strData2 = {
45 "One", "Two", "Three", "Four", "Five", "Six", "Seven"
46 };
47
48 public static void main(String[] args) throws Throwable {
49 SwingUtilities.invokeAndWait(new Runnable(){
50 public void run() {
|