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

JscrollPane behaves incorrectly when resetting layout manager

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • beta
    • generic
    • generic



      Name: skT45625 Date: 03/31/2000


      Classic VM (build Linux_JDK_1.2.2_RC4, native threads, sunwjit)


      This error was produced with the RC4 blackdown release. However it
      appears from to be a generic problem.

      It is possible to replace the layout manager of a JScrollPane. Whilst
      it is clear that the JScrollPane is designed to work specificially with
      the ScrollPane Layout it should be possible to replace the layout manager
      with a subclass. However any attempt to do this results in empty screen.
      The reason for this is I think that the components already placed in on
      the scroll pane in its constructor are not added to the LayoutManager
      when it is replaced, but I could well be wrong with this.

      This problem can be readily demonstrated with the SwingSet demo, by
      changing the scroll pane constructor with the following code...

         public ScrollPanePanel() {
              setLayout(new BorderLayout());
      JScrollPane pane = new TigerScrollPane();
      pane.setLayout( new ScrollPaneLayout() );
      add( pane, BorderLayout.CENTER);

          }

      I realise that the original designers of JScrollPane could see no reason to
      do this, but I need to move the column header component from the top of the
      pane to the bottom (immediately above the scroll bar) for what seem to me to
      be rather good reasons. Alternatively the setLayout method should throw a
      runtime exception (as it does in the case of a non ScrollPaneLayout being used).
      (Review ID: 103125)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: