レイラMOZAFFAR:
私は、ボタンの背景と前景の色の両方を変更したいです。私はsetBackgroundとsetForegroundとsetOpaque(true)を使用し、それはフォアグラウンドのためではなく、ボタンの背景のために働きました。そこ種類のボタンの周りに黒い境界線などであるが、私は、ボタン自体が黒になりたいです。どのように私はそれを修正しますか?
this.closeButton = new JButton ("Close");
this.closeButton.setBackground(Color.BLACK);
this.closeButton.setForeground(Color.PINK);
this.closeButton.setOpaque(true);