package java實踐;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JLabel;
import javax.swing.JTextArea;
public class WindowColor{
WindowColor(JButton button,JLabel label,JTextArea textArea){
Color newcColor=JColorChooser.showDialog(null,"調(diào)色板",button.getBackground());
label.setForeground(newcColor);
textArea.setForeground(newcColor);
}
}