This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternalFrame" Watch "JInternalFrame" New topic
Author

JInternalFrame

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(String.java:1438)
at JarLocation.btnCreateActionPerformed(JarLocation.java:297)
at JarLocation.access$700(JarLocation.java:28)
at JarLocation$8.actionPerformed(JarLocation.java:250)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

plz tell me possibel solution ASAP

kalai
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 JarLocation.java (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: http://aspose.com/file-tools
 
subject: JInternalFrame
 
Similar Threads
how to use parseInt()
internal frame
problem regarding batch file
error handling
iam hetting error when compile a File open service