Answers for "placeholder textField"

20

placeholder textfield flutter

TextField(
              onChanged: (value) {
                //Do something with the user input.
              },
              decoration: InputDecoration(
                hintText: 'Enter your password.',
                contentPadding:
                    EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
                border: OutlineInputBorder(
                  borderRadius: BorderRadius.all(Radius.circular(32.0)),
                ),
                enabledBorder: OutlineInputBorder(
                  borderSide:
                      BorderSide(color: Colors.lightBlueAccent, width: 1.0),
                  borderRadius: BorderRadius.all(Radius.circular(32.0)),
                ),
                focusedBorder: OutlineInputBorder(
                  borderSide:
                      BorderSide(color: Colors.lightBlueAccent, width: 2.0),
                  borderRadius: BorderRadius.all(Radius.circular(32.0)),
                ),
              ),
            ),
Posted by: Guest on August-25-2020
1

jtextfield placeholder

txtField = new JTextField();
txtField.setForeground(Color.LIGHT_GRAY);
txtField.addFocusListener(new FocusAdapter() {
			@Override
			public void focusGained(FocusEvent e) {
				if(txtField.getText().trim().equals("Hello World")) {
					txtField.setText("");
				}
				
				txtField.setForeground(Color.BLACK);
			}
			@Override
			public void focusLost(FocusEvent e) {
				if(txtField.getText().trim().equals("")) {
					txtField.setText("Hello World");
				}
				
				txtField.setForeground(Color.LIGHT_GRAY);
			}
		});
Posted by: Guest on December-30-2020

Code answers related to "placeholder textField"

Browse Popular Code Answers by Language