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

  • Home
  • SEARCH
  • 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 6869421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:33:20+00:00 2026-05-27T03:33:20+00:00

In my case I have 2D ArrayList full of objects that have data which

  • 0

In my case I have 2D ArrayList full of objects that have data which is used when drawing horizontal lines, vertical lines and filled rectangles. In different cases the amount of objects is different and the image has a different amount of drawn lines and rectangles. But the image needs to be redrawn sometimes. The more stuff there is to redraw, the stronger the flashes on the screen (I hope you can figure out what I mean with “flashes”).

I have already tried double buffering, but I don’t think I’m doing it right- the type of the flashes only changes… But that’s not the current case.

I have read that it’s easy to add and remove elements (no matter the type) anywhere from the ArrayList, but the access to them is hard. I have also read that the List performs better that the ArrayList (does that mean that the program will require less resources fro the computer?), but it’s only easy to add and remove elements from the end. But I’m not sure if the Array’s performance is the fastest. And this is making me think that the flashes can become weaker if I change the ArrayList with an Array or List.

It won’t be a problem in my case because all the elements that I store in the ArrayList are form the same class.

My question is: Can I weaken the flashes if I replace the ArrayList with an Array or List?

  • 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-27T03:33:21+00:00Added an answer on May 27, 2026 at 3:33 am

    OK, two problems here. The ArrayList vs. List question has no effect on “flashing”, since the difference in performance is small. If your list items are all of the same type or if they all derive from a common base type other than object or if they all implement a common interface, then List<T> is the better choice. This is because less castings or even boxings/unboxings are involved. In addition, it will be easier to access your items.

    Flashing: Do all your drawing in a paint-event method (of your form or of some control). Then call the Invalidate method of this form or control. Don’t draw “directly”. As an improvement, you can pass a rectangle structure to Invalidate, telling which part has to be redrawn. In the paint method, you can then check e.ClipRectangle, which tells you which part has to be redrawn. This gives you the opportunity to make some improvements here. However, be aware of the fact, that the Windows OS itself can trigger an Invalidate, which results in arbitrary ClipRectangles.

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

Sidebar

Related Questions

If I have an ArrayList that has lines of data that could look like:
I have different objects which is used to store the data from DB in
I have a regular .NET application. In this case I have a part that's
I have a case that keeps coming up where I'm using a ListView or
Problem: I have a method that creates a list from the parsed ArrayList. I
I have some arraylist with different objects of the same interface type, e.g: Interface
I have a fairly large chunk of code that produces/returns an arraylist of search
I have list of files stored inside arraylist that I need to download in
This one should be pretty simple. The use case is that I have a
Is it possible to have a servlet that contains an object (an ArrayList in

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.