Code:
import java.awt.FlowLayout;
import javax.swing.JApplet;
import javax.swing.JTextField;
 

public class ShowOrHide extends JApplet{
 
        public void init(){
               
               
                this.getContentPane().setLayout(new FlowLayout());
 
               
                JTextField field123 = new JTextField(" Show Hide Example", 10);
               
                
               
                field123.setVisible(false);
               
                               
                add(field123);
        }
}