Transparency for JTextField not working

后端 未结 3 1980
离开以前
离开以前 2021-01-28 16:08

I\'m working on a log in server & my JTextFields aren\'t transparent when I set Opaque to false.

My code:

//username  
             


        
3条回答
  •  故里飘歌
    2021-01-28 16:51

    I tried with another option and it worked for me.

    You can modify the property Background of the textfield. Select the option custom code in the Selection Box and paste new Color(0, 0, 0, 0)in the txtField.setBackground property.

    Then just change the border property to No border. and finally uncheck the opaque checkbox.

    Here a capture of my netbeans interface

提交回复
热议问题