File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JInternalFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternalFrame" Watch "JInternalFrame" New topic


kalai sundar
Ranch Hand

Joined: May 25, 2005
Posts: 69
in my program from one internal frame i am calling another internal frame, when i do that i ma geting the follwing exception

java.lang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.String.substring(
at JarLocation.btnCreateActionPerformed(
at JarLocation.access$700(
at JarLocation$8.actionPerformed(
at javax.swing.AbstractButton.fireActionPerformed(
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(
at javax.swing.DefaultButtonModel.fireActionPerformed(
at javax.swing.DefaultButtonModel.setPressed(
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
at java.awt.Component.processMouseEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.LightweightDispatcher.retargetMouseEvent(
at java.awt.LightweightDispatcher.processMouseEvent(
at java.awt.LightweightDispatcher.dispatchEvent(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

plz tell me possibel solution ASAP

Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
What do you mean by 'calling'? You are trying to construct another internal frame (i.e using 'new')? Or you are trying to call a method on another internal frame?
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Your poblem is that fact your trying to create a subString from one string and passing it invalid indexes. How this relates to swing/or a JInternalFrame, I can't tell you, no one here is going to be able to tell you. You either need to post some of your code (the stuff throwing the exception) or explain your question better.

Look at your code in (I'm assuming thats your code) for where you're using .substring(x, y) and try to figure out why its not working (are you passing in the correct string? is empty? is it as long as you think it is? ). I don't mean to sound harsh, but learn how to read the stack trace printout to find where your exception is and then post that block of code with your question if you still can't figure it out. If you don't understand what the exception means well ask that question.
I agree. Here's the link:
subject: JInternalFrame
It's not a secret anymore!