Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: offset out of bounds #1

Open
GoogleCodeExporter opened this issue Mar 19, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. I attached my small project that uses SyntaxHighlighter
2. To see the problem Please run model.Main class . 
Then, choose menu 'File' 
and 'Open' menuItem to open HTML file. Must be HTML file.

What is the expected output? What do you see instead?
The exception is :
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: 
offset out of bounds
    at java.text.RuleBasedBreakIterator.checkOffset(Unknown Source)
    at java.text.RuleBasedBreakIterator.preceding(Unknown Source)
    at javax.swing.text.GlyphView.getBreakSpot(Unknown Source)
    at javax.swing.text.GlyphView.getMinimumSpan(Unknown Source)
    at javax.swing.text.ParagraphView.calculateMinorAxisRequirements(Unknown Source)
    at javax.swing.text.BoxView.checkRequests(Unknown Source)
    at javax.swing.text.BoxView.getMinimumSpan(Unknown Source)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(Unknown Source)
    at javax.swing.text.BoxView.checkRequests(Unknown Source)
    at javax.swing.text.BoxView.setSpanOnAxis(Unknown Source)
    at javax.swing.text.BoxView.layout(Unknown Source)
    at javax.swing.text.BoxView.setSize(Unknown Source)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(Unknown Source)
    at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(Unknown Source)
    at javax.swing.JComponent.getPreferredSize(Unknown Source)
    at javax.swing.JEditorPane.getPreferredSize(Unknown Source)
    at syntaxhighlight.JTextComponentRowHeader.getPreferredSize(JTextComponentRowHeader.java:271)
    at javax.swing.ViewportLayout.layoutContainer(Unknown Source)
    at java.awt.Container.layout(Unknown Source)
    at java.awt.Container.doLayout(Unknown Source)
    at syntaxhighlight.JTextComponentRowHeader.updatePanelSize(JTextComponentRowHeader.java:234)
    at syntaxhighlight.JTextComponentRowHeader.checkPanelSize(JTextComponentRowHeader.java:224)
    at syntaxhighlight.JTextComponentRowHeader$1.handleEvent(JTextComponentRowHeader.java:187)
    at syntaxhighlight.JTextComponentRowHeader$1.insertUpdate(JTextComponentRowHeader.java:168)
    at javax.swing.text.AbstractDocument.fireInsertUpdate(Unknown Source)
    at javax.swing.text.AbstractDocument.handleInsertString(Unknown Source)
    at javax.swing.text.AbstractDocument.insertString(Unknown Source)
    at syntaxhighlight.SyntaxHighlighterPane.setContent(SyntaxHighlighterPane.java:308)
    at syntaxhighlight.SyntaxHighlighter.setContent(SyntaxHighlighter.java:259)
    at syntaxhighlight.SyntaxHighlighter.setContent(SyntaxHighlighter.java:249)
    at model.SyntaxHighlighterManager.setContent(SyntaxHighlighterManager.java:50)
    at model.SyntaxHighlighterManager.viewHTML(SyntaxHighlighterManager.java:63)
    at model.FileViewerManager.viewFile(FileViewerManager.java:15)
    at model.FileMenuAction.openFile(FileMenuAction.java:41)
    at model.FileMenuAction.actionPerformed(FileMenuAction.java:31)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

What version of the product are you using? On what operating system?
JDK 1.7u51 and Windows 7.

Please provide any additional information below.
I attached my project. 

Original issue reported on code.google.com by [email protected] on 11 Apr 2014 at 4:25

Attachments:

@GoogleCodeExporter
Copy link
Author

Note, when Html file is selected by fileChooser the main frame is validated and 
repainted in method Main.setContent(Container content).

Original comment by [email protected] on 11 Apr 2014 at 4:30

@GoogleCodeExporter
Copy link
Author

Hi, I've run your program, open the file 'Notepad+++/src/model/test.htm' in 
your attachment, and it shows on the UI without any exception. My version is 
JDK 1.7u40 and Windows 7.

Original comment by [email protected] on 14 Apr 2014 at 3:36

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

No branches or pull requests

1 participant