Check out example codes for "set color of text for jlabel". It will help you in understanding the concepts better.

Code Example 1

JLabel title = new JLabel("Want a Raise?", JLabel.CENTER);
title.setForeground(Color.white);

Learn ReactJs, React Native from akashmittal.com