Hello all, I am “very” new to Java and fairly new to programming in general.  I have been reading the “Head First Java” book and while doing one of the examples came across an observation. I created a colored circle and a button when you click the button the circle changes to a random color with the repaint() method. I have dual monitors set up and what I noticed was that If I were to drag the window to the second monitor it fires the repaint() method. Can anyone explain why this happens? I know this is probably something as a new programmer I don’t need to know right now but it did intrigue me so I thought I would ask.

Views: 61

Reply to This

Happy 10th year, JCertif!

Notes

Welcome to Codetown!

Codetown is a social network. It's got blogs, forums, groups, personal pages and more! You might think of Codetown as a funky camper van with lots of compartments for your stuff and a great multimedia system, too! Best of all, Codetown has room for all of your friends.

When you create a profile for yourself you get a personal page automatically. That's where you can be creative and do your own thing. People who want to get to know you will click on your name or picture and…
Continue

Created by Michael Levin Dec 18, 2008 at 6:56pm. Last updated by Michael Levin May 4, 2018.

Looking for Jobs or Staff?

Check out the Codetown Jobs group.

 

Enjoy the site? Support Codetown with your donation.



InfoQ Reading List

Git 2.48: Modernized with Meson Build System, Memory Leaks Fixed

Git 2.48 now supports the Meson build system, a modern alternative to the existing Makefile, Autoconf, and CMake-based systems. This change addresses limitations in IDE support and maintenance issues with older systems.

By Aditya Kulkarni

Fluent Assertions Library v8 Abandons Apache Licensing

Fluent Assertions, a well-known .NET library that allows expressive asserts in unit tests, has launched version 8 with a proprietary license in partnership with Xceed, replacing the existing Apache 2.0 licence. The new license allows free non-commercial use, but any commercial use will require a paid license. The move has been negatively received by the developer community.

By Edin Kapić

Creating Accessible Websites Using the Web Content Accessibility Guidelines

Web accessibility is about making web content available to users with disabilities. Development teams can use the success criteria of the Web Content Accessibility Guidelines to improve accessibility and create an inclusive website.

By Ben Linders

Presentation: Unleashing the Potential of VR: Building Immersive Experiences with Familiar Tools

Ian Thomas discusses VR software development, how to create immersive VR apps using familiar tools like React and JavaScript, making VR development accessible to Frontend Developers.w

By Ian Thomas

Apple New In-App Purchases API for Creator Platforms and Large Catalogs

Apple's new Advanced Commerce API provides iOS developers more flexibility to dynamically manage large content catalogs, creator experiences, and subscriptions with optional add-ons, such as premium features. For a developer to be allowed to use the new API, they must request access to Apple.

By Sergio De Simone

© 2025   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service