JTextField.setToolTipText(String s) Example

ToolTipText is a string that is displayed when user moves mouse cursor over a swing component like JButton , JTextArea ,JLabel, JTextField...

JTextField.setToolTipText(String s) Example
ToolTipText is a string that is displayed when user moves mouse cursor over a swing component like JButton,JTextArea,JLabel,JTextField etc

JTextField setToolTipText example

[
import javax.swing.JFrame;
import javax.swing.JTextField;



public class JavaJTextField extends JFrame{
    JavaJTextField()
    {
        super("JTextField Tooltiptext");


        JTextField field=new JTextField();

        field.setToolTipText("Enter your name");

        field.setBounds(50,50, 150,20);
        add(field);





        setSize(400,400);
        setLocationRelativeTo(null);
        setLayout(null);
        setVisible(true);

    }


    public static void main(String args[])
    {


        new JavaJTextField();

    }


}
]

[field.setToolTipText("Enter your name");] this is the code that sets tooltiptext.Run above code and hover the mouse over the JTextField, "Enter your name " text will pop up.

JTextField setEditable example

setEditable() function is used to enable or disable user inputs.If you setEditable(false),user cannot enter any input in that field.
[
import javax.swing.JFrame;
import javax.swing.JTextField;



public class JavaJTextField extends JFrame{
    JavaJTextField()
    {
        super("JTextField Tooltiptext");


        JTextField field=new JTextField();

        field.setToolTipText("Enter your name");
        field.setEditable(false);

        field.setBounds(50,50, 150,20);
        add(field);





        setSize(400,400);
        setLocationRelativeTo(null);
        setLayout(null);
        setVisible(true);

    }


    public static void main(String args[])
    {


        new JavaJTextField();

    }


}
]

Output



COMMENTS

Name

android android Apps android emulators antivirus blogger bluestack Break Statement in Java constructors download downloader drivers emulators java java control statements java do-while loop java for loop java infinitive do-while loop java system methods java tutorials Java While Loop java.awt java.swing javalookandfeel javascript JButton JCheckBox JColorChooser JComboBox JDialog JFileChooser JFrame JLayeredPane JList JMenuBar joomla JOptionPane JPanel JPasswordField JPopupMenu JProgressBar JRadioButton JScrollBar JSlider JSpinner JTabbedPane JTable JTextArea JTextField JToolBar mysql php plugins Polymorphism setToolTiptext skype for windows software swing class themes Visual Studio Code WeChat whatsapp wordpress
false
ltr
item
Java Codes: JTextField.setToolTipText(String s) Example
JTextField.setToolTipText(String s) Example
https://2.bp.blogspot.com/-jYfezmNGCsM/WL0PWxhBt6I/AAAAAAAAHDQ/lFPdEJarxwci37xn2PboYWeGUmW6ntYAgCLcB/s200/Jtextfield-settooltiptext-example-min.PNG
https://2.bp.blogspot.com/-jYfezmNGCsM/WL0PWxhBt6I/AAAAAAAAHDQ/lFPdEJarxwci37xn2PboYWeGUmW6ntYAgCLcB/s72-c/Jtextfield-settooltiptext-example-min.PNG
Java Codes
http://www.download-all.net/2017/03/jtextfieldsettooltiptextstring-s-example.html
http://www.download-all.net/
http://www.download-all.net/
http://www.download-all.net/2017/03/jtextfieldsettooltiptextstring-s-example.html
true
7826648292785071009
UTF-8
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy