prefer official Java 9 operations;
authorwenzelm
Tue, 05 Jan 2021 21:58:00 +0100
changeset 73072 7460f92d63fc
parent 73071 f996348d28ee
child 73073 a1d4c9f5207a
prefer official Java 9 operations;
src/Pure/GUI/gui.scala
--- a/src/Pure/GUI/gui.scala	Tue Jan 05 21:47:36 2021 +0100
+++ b/src/Pure/GUI/gui.scala	Tue Jan 05 21:58:00 2021 +0100
@@ -7,7 +7,7 @@
 package isabelle
 
 import java.awt.{Component, Container, Font, Image, Insets, KeyboardFocusManager, Window, Point,
-  Rectangle, Dimension, GraphicsEnvironment, MouseInfo, Toolkit}
+  Rectangle, Dimension, GraphicsEnvironment, MouseInfo, Toolkit, Taskbar}
 import java.awt.font.{FontRenderContext, LineMetrics, TextAttribute, TransformAttribute}
 import java.awt.geom.AffineTransform
 import javax.swing.{ImageIcon, JButton, JDialog, JFrame, JLabel, JLayeredPane, JOptionPane,
@@ -164,11 +164,7 @@
   def set_application_icon()
   {
     if (Platform.is_macos) {
-      val image = isabelle_image_large()
-      val app =
-        Class.forName("com.apple.eawt.Application")
-          .getDeclaredMethod("getApplication").invoke(null)
-      app.getClass.getDeclaredMethod("setDockIconImage", classOf[Image]).invoke(app, image)
+      Taskbar.getTaskbar.setIconImage(isabelle_image_large())
     }
   }