About 1,140,000 results
Open links in new tab
  1. swing - Java JTextField with input hint - Stack Overflow

    Sep 10, 2018 · In the paintSafely(), you would have to call setFont(fontHint) or setFont(fontOriginal) according to whether getText().isEmpty(), where fontHint would have been derived from the original getFont() in constructor.

  2. java - Adding hint to TextField - Stack Overflow

    After some research I found that this is an integrated feature in all of the input controls (TextField, TextArea, DateField, ComboBox). It's called "input prompt", no need to create it again. textField.setInputPrompt ("Hint");

  3. textfield - How to add prompt text/ hint to a text field in Java ...

    Aug 27, 2014 · The text field when blank shows three parts hinting first, second and last name. When initially on forcus, only the first name hint dissapeared, but the others, second and last remained.

  4. Java Swing | JTextField - GeeksforGeeks

    Dec 3, 2021 · Methods of the JTextField are: setColumns (int n) :set the number of columns of the text field. setFont (Font f) : set the font of text displayed in text field. addActionListener (ActionListener l) : set an ActionListener to the text field. int getColumns () :get the number of columns in the textfield. Following are the programs to implement ...

  5. How to Implement Input Hints in a Java JTextField

    In Java Swing, adding input hints to a JTextField can enhance user experience by guiding users on what to input. This guide provides a step-by-step process to implement an input hint similar to HTML's placeholder functionality.

  6. How2Java.com: How to Create Simple HintTextField in Java

    HintTextField display initial text into your TextField. Now we create an our own HintTextField. Create class HintTextField that extends an JTextField class. Override some properties of JTextField class, to customize and create an our HintTextField. Here we need to override two event focusGained () and focusLost ().

  7. JTextField basic tutorial and examples - CodeJava.net

    Jul 6, 2019 · How to use JTextField component in Java Swing programs: creating, setting text, tooltip, input focus, event listeners, text selection, etc.

  8. Java jTextField add hint text function - Programmer Sought

    In xcode, textfield adds hint text just by customizing the text in the right side of the ribbon, but when developing Java.swing under eclipse (although almost no one uses swing to do the GUI...), you need to customize Focus events to create prompt text.

  9. Creating User-Friendly JTextField Forms with Input Hints in Java

    Jun 22, 2024 · When working with Java Swing applications that utilize text input, providing a hint or placeholder text within a JTextField component can greatly enhance user experience by offering guidance on the expected input.

  10. does anyone know how to give a hint text in textFields in java ...

    Aug 11, 2015 · anyone know how to give a hint text in textField in java netbeans. eg: Text Field where user have to enter his Name i wanna give hidden text "name" You can use setToolTipText. first set the text of the textfield to "Name". jTextField2.setText(null);

  11. Some results have been removed
Refresh