i need to know if there is a way to make the progrm change the background color of a button next to another button
[
(button.next).setBackground(new Color(0,0,204));

No, because the button has no concept of what it is next to. That depends on where you put them, so you have to code your own method to determine what "next to" should be. Of course, the component does know things like it's local coordinates, which could certainly be used to figure it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.