Java JButton set text label color
import java.awt.Color; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; public class Main extends JFrame { public Main() { super("JButton"); setDefaultCloseOperation(EXIT_ON_CLOSE); setLayout(new FlowLayout()); JButton bn = new JButton("Close"); bn.setForeground(new Color(0xffffdd)); //from w w w . j ava 2 s. co m getContentPane().add(bn); } public static void main(String[] args) { Main frame = new Main(); frame.pack(); frame.setVisible(true); } }