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

doLayout does not always show newly added components

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.1.6
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      Name: diC59631 Date: 04/21/98


      I am using a JPanel with BorderLayout to act as
      a container to show different JComponents. (This
      is a workflow application and I want to show each
      'workitem' on the client screen).

      I add a component to be displayed with:

      pnWorkArea.add( (new JPanel()), BorderLayout.CENTER );
      pnWorkArea.doLayout();

      (That code works, when adding a new JPanel),

      This code, which gets a newly created item
      from the server also works:

      wfi = app.getNewWorkItem( wt );

      JPanel wfid = wfi.getDisplay();
      pnWorkArea.add( wfid, BorderLayout.CENTER );
      pnWorkArea.doLayout();

      However, when I get an existing work item from
      the server and try to add it:

      wfi = app.getNextWorkItem();

      if ( null == wfi )
      {
        wfid = new NoWorkPanel();
      }
      else
      {
        wfid = wfi.getDisplay();
      }

      pnWorkArea.removeAll();
      pnWorkArea.add( (new JPanel()), BorderLayout.CENTER );
      pnWorkArea.doLayout();
      pnWorkArea.removeAll();
      pnWorkArea.doLayout();
      pnWorkArea.add( wfid, BorderLayout.CENTER );
      pnWorkArea.doLayout();

      This does not work, it does *nothing at all*
      until I manually resize the applet.
      Notice that I tried clearing out everything in
      the container to make it seem like it was
      getting something new (which did seem to work).

      So, something is weird with doLayout that does not
      seem to be setting the appropriate dirty flags?

      If you want, I can send you complete working code
      for this problem.
      (Review ID: 28162)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              son Oleg Sukhodolsky (Inactive)
              Reporter:
              dindrigo Daniel Indrigo (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: