Home » Desktop Java » swing » JTextField

JTextField

Create JTextField with border

In this tutorial we are going to see how to create a JTextField with border. This is a very simple way to make your component a little bit more interesting. In short, in order to create a new JTextField with border, one should follow these steps: Create a class that extends JFrame. Create a new JTextField. Use BorderFactory.createLineBorder(Color.BLUE, 5) to ...

Read More »

Create JTextField with tooltip

With this example we are going to learn how to create a JTextField with a tootip. Tooltip texts are very useful because they explain to the users how to use a specific component. It’s very easy to set a tooltip text in a JTextField as all you have to do is: Create a class that extends JFrame. Create a new ...

Read More »

Create read-only (non-editable) JTextField

In this example we are going to see how to create read-only JTextFields in Java Desktop Applications. This is very useful in many occasions. In order to create a non editable JTextField, all you have to do is: Create a class that extends JFrame. Create a new JTextField. Use setEditable(false) that sets the specified boolean to indicate whether or not ...

Read More »

Create new JTextField

In this example we are going to see how to create a new JTextField component in a Java Desktop Application. Text fields in general are one of the most common ways for you application to get user input. Using text fields you give the user the ability to provide text input to your app. It’s very easy to create a ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns