< prev index next >

test/jdk/java/awt/image/multiresolution/MultiResolutionTrayIconTest/MultiResolutionTrayIconTest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 23,33 **** /** * @test * @key headful ! * @bug 8150176 8151773 8150176 * @summary Check if correct resolution variant is used for tray icon. * @run main/manual/othervm -Dsun.java2d.uiScale=2 MultiResolutionTrayIconTest */ import java.awt.Color; import java.awt.Dimension; --- 23,33 ---- /** * @test * @key headful ! * @bug 8150176 8151773 8150176 8241791 * @summary Check if correct resolution variant is used for tray icon. * @run main/manual/othervm -Dsun.java2d.uiScale=2 MultiResolutionTrayIconTest */ import java.awt.Color; import java.awt.Dimension;
*** 71,81 **** public static void createUI() throws Exception { SwingUtilities.invokeAndWait(new Runnable() { public void run() { mainFrame = new JFrame("TrayIcon Test"); ! boolean trayIsSupported = SystemTray.isSupported(); tray = SystemTray.getSystemTray(); Dimension d = tray.getTrayIconSize(); icon = new TrayIcon(createIcon(d.width, d.height)); icon.setImageAutoSize(true); layout = new GridBagLayout(); --- 71,85 ---- public static void createUI() throws Exception { SwingUtilities.invokeAndWait(new Runnable() { public void run() { mainFrame = new JFrame("TrayIcon Test"); ! if (!SystemTray.isSupported()) { ! System.out.println("system tray is not supported"); ! latch.countDown(); ! return; ! } tray = SystemTray.getSystemTray(); Dimension d = tray.getTrayIconSize(); icon = new TrayIcon(createIcon(d.width, d.height)); icon.setImageAutoSize(true); layout = new GridBagLayout();
*** 96,115 **** gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; mainControlPanel.add(instructionText, gbc); startButton = new JButton("Start"); startButton.setActionCommand("Start"); - if (trayIsSupported) { - startButton.addActionListener((ActionEvent e) -> { doTest(); }); - } else { - startButton.setEnabled(false); - System.out.println("system tray is not supported"); - latch.countDown(); - } gbc.gridx = 0; gbc.gridy = 0; resultButtonPanel.add(startButton, gbc); passButton = new JButton("Pass"); --- 100,112 ----
*** 193,198 **** if (tray != null) { tray.remove(icon); } } } - --- 190,194 ----
< prev index next >