Quantcast
Viewing all articles
Browse latest Browse all 102

Answer by mikyll98 for How to add color background in the button admin and user? I want to change into color blue

To change the background color of a JButton, you can use setBackground() method, passing a java.awt.Color.

From the docs, for setBackground():

Sets the background color of this component. The background color is used only if the component is opaque, and only by subclasses of JComponent or ComponentUI implementations. Direct subclasses of JComponent must override paintComponent to honor this property.

Example:

btnAdmin.setBackground(Color.BLUE);

Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>