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

Wrong height using Synth and JTabbedPane (SCROLL_TAB_LAYOUT)

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0_10"
      Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
      Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      I am using an own Synth LookAndFeel and I have a JTabbedPane. As soon as I switch to SCROLL_TAB_LAYOUT I am getting a wrong height in the callback

          public void paintTabbedPaneTabAreaBackground(final SynthContext context, final Graphics g, final int x, final int y,
                  final int w, final int h, final int orientation)

      The height h seems to be there the complete height of the component, not only of the tabarea. When I don't use SCROLL_TAB_LAYOUT, I am getting the correct height of the tabarea.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Using a Synth LookAndFeel and a JTabbedPane with SCROLL_TAB_LAYOUT

      Please execute main-method of TestDialog. The dialog shows two
      JTabbedPanes with different tablayoutpolicies. The console shows the
      parameter "height" of the paintTabbedPaneTabAreaBackground callback.

      I expect the same height of the tabarea for both tabbedpanes. But they
      are different. When resizing the window/jtabbedpane I can see, that one
      value is increasing, but the height of the tabarea is still the same of
      course.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Getting the correct height of the tabarea in

          public void paintTabbedPaneTabAreaBackground(final SynthContext context, final Graphics g, final int x, final int y,
                  final int w, final int h, final int orientation)
      ACTUAL -
      Getting the complete height of the component in

          public void paintTabbedPaneTabAreaBackground(final SynthContext context, final Graphics g, final int x, final int y,
                  final int w, final int h, final int orientation)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Attached seperatly
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Calculating the real tabheight with context.getComponent().getUI().getTabBounds(context.getComponent()).getHeight()

      Attachments

        Activity

          People

            peterz Peter Zhelezniakov
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Imported:
              Indexed: