Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7965931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:17:06+00:00 2026-06-04T06:17:06+00:00

This is my first time using stackoverflow for a question that I need to

  • 0

This is my first time using stackoverflow for a question that I need to ask, so hopefully I can get some help. This is a school assignment that I am working on, and although I have already turned it in and am going to change the code pretty drastically soon, I would like to figure out what is wrong first. This is basically a purchase history program, where the past purchases are stored and can be accessed as receipts with a ‘next’ and ‘back’ button. There is no file access, and all the data is generated randomly. The random data generation wasn’t a requirement of the assignment, but I wanted to do it that way as a learning experience.

On to the question, what is going on with this error?

    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 9, Size: 9
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at farmmark.Storage.getItems(Storage.java:36)
at farmmark.Gui.buttonActionNext(Gui.java:415)
at farmmark.Gui$ButtonHandler.actionPerformed(Gui.java:632)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6290)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6055)
at java.awt.Container.processEvent(Container.java:2039)
at java.awt.Component.dispatchEventImpl(Component.java:4653)
at java.awt.Container.dispatchEventImpl(Container.java:2097)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
at java.awt.Container.dispatchEventImpl(Container.java:2083)
at java.awt.Window.dispatchEventImpl(Window.java:2482)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:607)
at java.awt.EventQueue$1.run(EventQueue.java:605)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:621)
at java.awt.EventQueue$2.run(EventQueue.java:619)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    BUILD SUCCESSFUL (total time: 6 seconds)

There is a lot of code, probably too much to post here, so here is a link to the source:
http://www.mediafire.com/?3ogc334vwh6t7k6

Here are the spots of code where the error occurs:

at farmmark.Storage.getItems(Storage.java:36)

public static String[] getItems(int select)
{
    return itemList.get(select);
}

at farmmark.Gui.buttonActionNext(Gui.java:415)

String items[] = Storage.getItems(counter);

at farmmark.Gui$ButtonHandler.actionPerformed(Gui.java:631)

else if(sel.equals("Next"))
        {
            jtxtItems.setText(null);
            jtxtPrices.setText(null);
            jtxtSkus.setText(null);
            jtxtCase.setText(null);
            jtxtVend.setText(null);
            panel.removeAll();
            buttonActionNext();
        {

Any help would be great, keep in mind I have only been programming in java for 8 weeks :P. Thanks in advanced!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:17:08+00:00Added an answer on June 4, 2026 at 6:17 am

    Here’s where to look:

    at farmmark.Storage.getItems(Storage.java:36)
    

    Here’s the method:

    public static String[] getItems(int select)
    {
        return itemList.get(select);
    }
    

    The value for select is either less than zero or greater than (itemList.length-1).

    Run in a debugger, set a breakpoint at that line, and see what’s up.

    I don’t see where either itemList or select is set. Take a look at those methods as well.

    Just curious – why is that method static?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first question on stackoverflow, hopefully there is someone who can help
This is my first time using stackoverflow for a question, I have read a
Sorry, this is my first time using this forum. Apparently people can edit my
This is my first time asking my question at stackoverflow. I'm working on a
This is my first time using StackOverflow myself. I have found many answers to
This is my first time using stackoverflow. I've been unable to find out the
Good morning, all. This is my first question on stackoverflow, so hopefully this isn't
First question ever on stackoverflow. Been reading for some time now, while trying to
this is my first question on stack overflow, I hope you can help me.
This is my first time using Eclipse 3.3.2 to make an application in Java.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.