のためのカスタムカラーの使用に示しますその中にJTextPane
があります。何が起こっているのアーティファクトは、カスタムメイドのカラーを使用した後JTextPaneの背景色
画像:
のでJTextPane
背景の下の部分はOKですが、テキストの後ろのトップ1は、いくつかの問題を抱えています。
どうすれば修正できますか? JTextPane
の単純な透明な背景にカスタムカラーを使用して間違いを犯しましたか?プログラムのこの部分のための
コード:
t = new JTextPane();
SimpleAttributeSet style = new SimpleAttributeSet();
StyleConstants.setAlignment(style , StyleConstants.ALIGN_CENTER);
StyleConstants.setForeground(style , Color.white);
StyleConstants.setFontFamily(style, "Times new Roman");
StyleConstants.setFontSize(style, 20);
StyleConstants.setBold(style, true);
t.setParagraphAttributes(style,true);
t.setText(" " + text.getT1().get(0).toUpperCase());
t.setOpaque(true);
Color bg = new Color(0f,0f,0f,0.5f);
t.setBackground(bg);
t.setEditable(false);
t.setBounds(250, 400, 300, 50);
animation.add(t);