Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Ribbon Band StringIndexOutOfBoundsException with no size preferences #121

Open
rodrigoazlima opened this issue Jun 25, 2013 · 1 comment

Comments

@rodrigoazlima
Copy link

Hello,
I have a poor english n i'm sorry about it...

I got an StringIndexOutOfBoundsException when i used an JPanel without size preferences who is inside a JRibbonComponent, and pass an not null or empty String to band title.

With debug i got in org.pushingpixels.substance.flamingo.ribbon.ui.SubstanceRibbonBandUI.paintBandTitle an Rectangle titleRectangle with width 1 and when the while statement start it's will delete all the title string param and try to delete more, but it's can't be deleted cuz the string is empty (title.length() as 0).

Notes: i'm using an JPannel without size rules.

My Solution: set the panel size rules.

My recomendation: check if the width is not able to print the colapsed string "..."

Stack Trace:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1911)
at org.pushingpixels.substance.flamingo.ribbon.ui.SubstanceRibbonBandUI.paintBandTitle(SubstanceRibbonBandUI.java:145)
at org.pushingpixels.flamingo.internal.ui.ribbon.BasicRibbonBandUI.paint(BasicRibbonBandUI.java:783)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at org.pushingpixels.flamingo.internal.ui.ribbon.BasicRibbonBandUI.update(BasicRibbonBandUI.java:741)
at org.pushingpixels.substance.flamingo.ribbon.ui.SubstanceRibbonBandUI.__org__pushingpixels__substance__flamingo__ribbon__ui__SubstanceRibbonBandUI__update(SubstanceRibbonBandUI.java)
at org.pushingpixels.substance.flamingo.ribbon.ui.SubstanceRibbonBandUI.update(SubstanceRibbonBandUI.java)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1512)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1443)
at javax.swing.RepaintManager.paint(RepaintManager.java:1236)
at javax.swing.JComponent._paintImmediately(JComponent.java:5169)
at javax.swing.JComponent.paintImmediately(JComponent.java:4980)
at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
at javax.swing.RepaintManager$3.run(RepaintManager.java:784)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:784)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:757)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:706)
at javax.swing.RepaintManager.access$1000(RepaintManager.java:62)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1651)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

@shemnon
Copy link

shemnon commented Jun 25, 2013

I don't have the time to maintain this project, and I am currently looking for a new maintainer.

http://speling.shemnon.com/blog/2013/06/08/insubstantial-needs-a-new-maintainer/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants