Changing the font color of a JLabel

Use the method setForeground.

Main.java:

import javax.swing.border.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.*;
import java.awt.*;
   
public class Main extends JFrame {
   public Main() {
      getContentPane().setLayout(new FlowLayout());
 
      JLabel label = new JLabel("The font and color of this JLabel have been changed!");
      getContentPane().add(label);  
      label.setFont(new Font("Tahoma", Font.ITALIC, 30));
      label.setForeground(Color.red);
 
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
            System.exit(0);   
         }      
      });
 
      pack();
   }
 
   public static void main(String[] args) {
      (new Main()).show();
   }
}