flamingo
  1. flamingo
  2. FLAMINGO-10

StringIndexOutOfBoundsException with empty JRibbonBand

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: milestone 1
    • Component/s: ribbon
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      10

      Description

      The following exception occurs when using an empty JRibbonBand. While empty
      JRibbonBands aren't particularly useful (hence P5), this is likely to occur
      during development (using them as placeholders for work to come shortly).

      Exception in thread "AWT-EventQueue-0"
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1938)
      at
      org.jvnet.flamingo.ribbon.ui.BasicRibbonBandUI.paintBandTitle(BasicRibbonBandUI.java:644)
      at
      org.jvnet.flamingo.ribbon.ui.BasicRibbonBandUI.paint(BasicRibbonBandUI.java:613)
      at javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)
      at
      org.jvnet.flamingo.ribbon.ui.BasicRibbonBandUI.update(BasicRibbonBandUI.java:583)
      at javax.swing.JComponent.paintComponent(JComponent.java:763)
      at javax.swing.JComponent.paint(JComponent.java:1027)
      at javax.swing.JComponent.paintChildren(JComponent.java:864)
      at javax.swing.JComponent.paint(JComponent.java:1036)
      at javax.swing.JComponent.paintChildren(JComponent.java:864)
      at javax.swing.JComponent.paint(JComponent.java:1036)
      at javax.swing.JComponent.paintChildren(JComponent.java:864)
      at javax.swing.JComponent.paint(JComponent.java:1036)
      at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
      at javax.swing.JComponent.paintChildren(JComponent.java:864)
      at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
      at
      javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
      at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
      at javax.swing.JComponent.paint(JComponent.java:1013)
      at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
      at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
      at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
      at java.awt.Container.paint(Container.java:1797)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:734)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
      at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
      at
      javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

        Activity

        Hide
        kirillcool added a comment -

        Should be fixed in the latest 3.1dev drop.

        Thanks
        Kirill

        Show
        kirillcool added a comment - Should be fixed in the latest 3.1dev drop. Thanks Kirill
        Hide
        flynnk added a comment -

        The exception no longer occurs under the default (Metal) L&F, but still occurs
        when using Substance-Flamingo. (I could file a bug in that project, but
        probably easier to just note it here--let me know if you prefer different.)

        Furthermore, the ribbon band now shows up as two pixels wide. It might be nicer
        for it to show up as having the width of the specified title and be empty.
        Principle of least surprise, pretty much.

        Show
        flynnk added a comment - The exception no longer occurs under the default (Metal) L&F, but still occurs when using Substance-Flamingo. (I could file a bug in that project, but probably easier to just note it here--let me know if you prefer different.) Furthermore, the ribbon band now shows up as two pixels wide. It might be nicer for it to show up as having the width of the specified title and be empty. Principle of least surprise, pretty much.
        Hide
        kirillcool added a comment -

        Reopening to fix for Substance-Flamingo and provide enough width to show the title.

        Show
        kirillcool added a comment - Reopening to fix for Substance-Flamingo and provide enough width to show the title.
        Hide
        kirillcool added a comment -

        Should be addressed in the latest 3.1dev drop of the core Flamingo library -
        respecting the title string of an empty ribbon band. This also fixes the
        exception under Substance.

        Thanks
        Kirill

        Show
        kirillcool added a comment - Should be addressed in the latest 3.1dev drop of the core Flamingo library - respecting the title string of an empty ribbon band. This also fixes the exception under Substance. Thanks Kirill
        Hide
        flynnk added a comment -

        Do I need to update to the latest Substance-Flamingo dev drop?

        Show
        flynnk added a comment - Do I need to update to the latest Substance-Flamingo dev drop?
        Hide
        flynnk added a comment -

        Never mind the previous comment.

        Closing, as I confirm it is fixed. I appreciate this one--I know it's not a big
        deal, but this exception drove me crazy for about 20 minutes as I tried to
        figure out exactly what I was doing wrong...

        Show
        flynnk added a comment - Never mind the previous comment. Closing, as I confirm it is fixed. I appreciate this one--I know it's not a big deal, but this exception drove me crazy for about 20 minutes as I tried to figure out exactly what I was doing wrong...

          People

          • Assignee:
            kirillcool
            Reporter:
            flynnk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: