jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java
changeset 10096 f9ac9a52952d
parent 5506 202f599c92aa
child 18241 3e009b5be123
equal deleted inserted replaced
10095:daec42746ec0 10096:f9ac9a52952d
   239         return Color.black;
   239         return Color.black;
   240     }
   240     }
   241     Font getFont () {
   241     Font getFont () {
   242         return ownerWindow.getFont();
   242         return ownerWindow.getFont();
   243     }
   243     }
       
   244 
       
   245     @Override
   244     public void repaint() {
   246     public void repaint() {
   245         Rectangle bounds = getBounds();
   247         final Rectangle bounds = getBounds();
   246         Graphics g = getGraphics();
   248         final Graphics g = getGraphics();
   247         try {
   249         if (g != null) {
   248             paint(g, 0, 0, bounds.width, bounds.height);
   250             try {
   249         } finally {
   251                 paint(g, 0, 0, bounds.width, bounds.height);
   250             g.dispose();
   252             } finally {
   251         }
   253                 g.dispose();
   252     }
   254             }
   253 
   255         }
       
   256     }
   254     @Override
   257     @Override
   255     public void handleExposeEvent(XEvent xev) {
   258     public void handleExposeEvent(XEvent xev) {
   256         super.handleExposeEvent(xev);
   259         super.handleExposeEvent(xev);
   257 
   260 
   258         XExposeEvent xe = xev.get_xexpose();
   261         XExposeEvent xe = xev.get_xexpose();
   261         final int width = xe.get_width();
   264         final int width = xe.get_width();
   262         final int height = xe.get_height();
   265         final int height = xe.get_height();
   263         SunToolkit.executeOnEventHandlerThread(target,
   266         SunToolkit.executeOnEventHandlerThread(target,
   264                 new Runnable() {
   267                 new Runnable() {
   265                     public void run() {
   268                     public void run() {
   266                         Graphics g = getGraphics();
   269                         final Graphics g = getGraphics();
   267                         try {
   270                         if (g != null) {
   268                             paint(g, x, y, width, height);
   271                             try {
   269                         } finally {
   272                                 paint(g, x, y, width, height);
   270                             g.dispose();
   273                             } finally {
       
   274                                 g.dispose();
       
   275                             }
   271                         }
   276                         }
   272                     }
   277                     }
   273                 });
   278                 });
   274     }
   279     }
   275 
   280