使TextArea的背景不透明

我想让TextArea的背景变得不透明。我在netbeans上使用swing gui表单。 我想重叠图像前面的指令(见图),但问题是如果它们在图像的前面则无法看到文本。我真的不知道不透明的背景是不是这里的问题(我使用分层窗格有一个JLabel图片所在的位置,并重叠TextArea,我放置了我的指示)。 你能帮我弄清楚问题是什么吗? 这是代码:
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JFrame;

public class About extends javax.swing.JDialog {

public About(JFrame owner) {
    super(owner, true);
    initComponents();
    setSize(500, 500);
    setLocation(300, 120);
    getContentPane().setBackground(Color.getHSBColor(204, 204, 255));
    jLabel1.setIcon(new ImageIcon("HangmanStartlight.jpg"));

 }

@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

    jTabbedPane1 = new javax.swing.JTabbedPane();
    jLayeredPane1 = new javax.swing.JLayeredPane();
    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jLabel1.setText("jLabel1");
    jLabel1.setBounds(0, 0, 420, 290);
    jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jTextArea1.setColumns(20);
    jTextArea1.setFont(new java.awt.Font("Microsoft Sans Serif", 1, 14)); // NOI18N
    jTextArea1.setForeground(new java.awt.Color(51, 0, 51));
    jTextArea1.setRows(5);
    jTextArea1.setText("HangmannnGuess the "HIDDEN PHRASE" to proceed to the nextnlevel.  Hangman is filled with several words, npresented in random order each time you play.nnhOw To pLay!!!nnYou can select letters by clicking on the letter buttonsnshown at the window.nnBe very careful! 'coz you are only allowed 10 wrongnguesses per puzzle.nnYou will at the corner Top-Left of the window your n"Name", your "Score", your "Level", your "Lives Left"nand also the "Life Line" which you can use as a Hint.nnEnjoy Playing and Have Fun :)");
    jTextArea1.setWrapStyleWord(true);
    jScrollPane1.setViewportView(jTextArea1);

    jScrollPane1.setBounds(0, 0, 420, 280);
    jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jTabbedPane1.addTab("tab1", jLayeredPane1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(26, 26, 26)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 427, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap(39, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(21, 21, 21)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap(128, Short.MAX_VALUE))
    );

    pack();
}// </editor-fold>
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JLayeredPane jLayeredPane1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextArea jTextArea1;
// End of variables declaration
}
附:我正在使用摇摆建设者/摇摆gui表格..     
已邀请:
尝试使用背景面板中的一个提示。     
编写自己的组件,在屏幕上手动绘制文本。这就是用Java制作游戏的方式,而不是Swing ...     

要回复问题请先登录注册