Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4110799

JInternalFrame icon position unchanged w/ resize

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.2.0
    • client-libs
    • swing1.0fcs
    • x86
    • windows_nt



      Name: rm29839 Date: 02/09/98


      Two internal frames are created in a JFrame.
      Each one of them is iconified and then
      uniconified. If the JFrame is then resized, the
      internal frames, when iconified, are positioned
      at the previous location, and not at the bottom
      of the JFrame.
      Here is the source code:
      -----------------------------------------------
      import com.sun.java.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      public class Test1 {
      public static void main( String[] args )
      {
      JFrame frame = new JFrame("Jframe");
      frame.setSize(500, 300);

      frame.addWindowListener( new WindowAdapter() {
      public void windowClosing( WindowEvent e ) {
      System.exit(0);
      }});

      JDesktopPane dp = new JDesktopPane();
      dp.setOpaque(true);
      frame.getContentPane().add(dp);

      Rectangle r = new Rectangle(10, 10, 150, 150);
      JInternalFrame iframe = createInternalFrame( "First", r, Color.red );
      dp.add(iframe, JLayeredPane.PALETTE_LAYER);

      r = new Rectangle(200, 100, 150, 150);
      iframe = createInternalFrame( "Second", r, Color.yellow );
      dp.add(iframe, JLayeredPane.PALETTE_LAYER);

      frame.setVisible(true);
      }

      public static JInternalFrame createInternalFrame(
      String name, Rectangle bounds, Color c )
      {
      JInternalFrame iframe = new JInternalFrame(name, true, true, true, true);
      iframe.setBackground( c );
      iframe.setBounds(bounds);
      return iframe;
      }
      }
      (Review ID: 24776)
      ======================================================================

            tballsunw Tom Ball (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: