/[classpath]/classpath/javax/swing/JOptionPane.java
ViewVC logotype

Diff of /classpath/javax/swing/JOptionPane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by mark, Sat Jul 2 20:32:48 2005 UTC revision 1.14 by rabbit78, Wed Jul 20 12:49:06 2005 UTC
# Line 384  public class JOptionPane extends JCompon Line 384  public class JOptionPane extends JCompon
384    }    }
385    
386    /**    /**
387     * This method creates a new JInternalFrame that is in the JDesktopPane     * This method creates a new JInternalFrame that is in the JLayeredPane
388     * which contains the parentComponent given. If no suitable JDesktopPane     * which contains the parentComponent given. If no suitable JLayeredPane
389     * can be found from the parentComponent given, a RuntimeException will be     * can be found from the parentComponent given, a RuntimeException will be
390     * thrown.     * thrown.
391     *     *
# Line 395  public class JOptionPane extends JCompon Line 395  public class JOptionPane extends JCompon
395     * @return A new JInternalFrame based on the JOptionPane configuration.     * @return A new JInternalFrame based on the JOptionPane configuration.
396     *     *
397     * @throws RuntimeException If no suitable JDesktopPane is found.     * @throws RuntimeException If no suitable JDesktopPane is found.
398       *
399       * @specnote The specification says that the internal frame is placed
400       *           in the nearest <code>JDesktopPane</code> that is found in
401       *           <code>parent</code>'s ancestors. The behaviour of the JDK
402       *           is that it actually looks up the nearest
403       *           <code>JLayeredPane</code> in <code>parent</code>'s ancestors.
404       *           So do we.
405     */     */
406    public JInternalFrame createInternalFrame(Component parentComponent,    public JInternalFrame createInternalFrame(Component parentComponent,
407                                              String title)                                              String title)
408                                       throws RuntimeException                                       throws RuntimeException
409    {    {
410      JDesktopPane toUse = getDesktopPaneForComponent(parentComponent);      JLayeredPane toUse = JLayeredPane.getLayeredPaneAbove(parentComponent);
411      if (toUse == null)      if (toUse == null)
412        throw new RuntimeException("parentComponent does not have a valid parent");        throw new RuntimeException
413            ("parentComponent does not have a valid parent");
414    
415      JInternalFrame frame = new JInternalFrame(title);      JInternalFrame frame = new JInternalFrame(title);
416    
# Line 411  public class JOptionPane extends JCompon Line 419  public class JOptionPane extends JCompon
419    
420      frame.setClosable(true);      frame.setClosable(true);
421      toUse.add(frame);      toUse.add(frame);
   
422      // FIXME: JLayeredPane broken? See bug # 16576      // FIXME: JLayeredPane broken? See bug # 16576
423      // frame.setLayer(JLayeredPane.MODAL_LAYER);      frame.setLayer(JLayeredPane.MODAL_LAYER);
424      return frame;      return frame;
425    }    }
426    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26