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 7617411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:08:40+00:00 2026-05-31T03:08:40+00:00

I got small problem i got error java.lang.IndexOutOfBoundsException: Index: 29, Size: 29 when i

  • 0

I got small problem i got error java.lang.IndexOutOfBoundsException: Index: 29, Size: 29 when i launch this one code error is in line if ((listaSwiat != null && listaSwiat.get(x) != null) || harm.get(y).getDzienTygodnia(x + 1).equals("Nd")) but dunno why index should be 30 not 29 any1 can help?

for (int y = 0; y < harm.size(); y++) {//wiersze
            c1 = new PdfPCell(new Phrase(harm.get(y).nazwa, stdFont));
            c1.setHorizontalAlignment(Element.ALIGN_CENTER);
            table.addCell(c1);
            c1 = new PdfPCell(new Phrase("" + harm.get(y).getSumaGodzin() + " / " + harm.get(y).normaGodzin, smallFont));
            c1.setHorizontalAlignment(Element.ALIGN_CENTER);
            table.addCell(c1);
            for (int x = 0; x < harm.get(y).dni.size(); x++) {//kolumny
                c1 = new PdfPCell(new Phrase(harm.get(y).dni.get(x).godziny, smallFont));
                //dla swiąt ustal kolor tła na czerwono
                //dla niedziel ustala kolor tla na czerwony
                if ((listaSwiat != null && listaSwiat.get(x) != null) || harm.get(y).getDzienTygodnia(x + 1).equals("Nd")) {
                    c1.setBackgroundColor(BaseColor.RED);
                }
  • 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-05-31T03:08:42+00:00Added an answer on May 31, 2026 at 3:08 am

    It looks like you are looping over all the elements of harm.get(y).dni and inside the loop you
    do

    if ((listaSwiat != null && listaSwiat.get(x) != null) 
    || harm.get(y).getDzienTygodnia(x + 1).equals("Nd"))
    

    The last time through the loop x = 28 and the size is 29. But you do

    harm.get(y).getDzienTygodnia(x + 1)
    

    So you get the element at spot 29 which is out of bounds, because like the other answer stated the index starts at 0 not 1. You have to add a check here to see if you are currently at the last index before checking the next index.

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

Sidebar

Related Questions

got a small problem, this code <form action=<?php echo $_SERVER['PHP_SELF']; ?> method=post> <?php ...
I've got a small problem. I launch my application and after launching a query
I got a small problem using pylint to check my python code. I use
I've got a small problem I'm struggling to solve. Let's say I've got an
I've got a small Cocoa problem. I have a StatusBar application that has an
Can anyone help with a small problem. I've got a nice simple CSS dropdown
I've got a problem with NHibernate trying to load a small hierarchy of data.
I've got a small bit of DRY going on in code I and others
Searching for solutions for my problem, I got this question , suggesting composite grammars
Im running into a small (newbie) problem. I've got 2 models: question & reviews.

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.