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: 62

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

Java News Roundup: OpenJDK JEP Updates, Spring AI, Quarkus, LangChain4j, JReleaser, WildFly

This week's Java roundup for April 28th, 2025 features news highlighting: four JEPs proposed to target and targeted for JDK 25; new JEPs; three new JEPs; the eighth milestone release of Spring AI 1.0.0; Quarkus 3.22.0; the first release candidate of LangChain4j 1.0.0; the release of JReleaser 1.18.0; and Wildfly joins the Commonhaus Foundation.

By Michael Redlich

Instance Main Methods Move from Preview to Final in JDK 25

JEP 512 enhances Java with Compact Source Files and Instance Main Methods in JDK 25, easing the learning curve for beginners. Key features include simplified syntax, automatic imports, and a new IO helper class, empowering developers to create programs with minimal complexity. These changes solidify Java's commitment to accessibility and innovation in programming.

By A N M Bazlur Rahman

How Slack Optimizes Its E2E Pipeline

Slack's Developer Experience (DevXP) team recently implemented significant optimizations to their end-to-end (E2E) testing pipeline, resulting in a 60% reduction in frontend build frequency and a 50% decrease in overall build time. These enhancements, the team claims, streamline the continuous integration and deployment (CI/CD) process, allowing engineers to iterate more rapidly and efficiently.

By Craig Risi

Podcast: How To Improve the Quality of the Gen AI-Generated Code And Your Team’s Dynamics

Birgitta Böckeler, Thoughtworks’ subject matter expert on Generative AI coding assistants, discusses how to enhance generated code by incorporating additional information into its context, and how your team’s dynamics will evolve with the adoption of these tools.

By Birgitta Böckeler

Article: Best Practices for Managing Shared Libraries in .NET Applications at Scale

This article discusses real-world cases of using shared libraries, their consequences, and possible solutions to blockers caused by using them in many dependent projects.

By Sergio Vanin

© 2025   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service