Swing Java create Text Box

0 votes
How to create a TextBox in java Swing to take input from user?
Aug 27 in Java by Brian
13 views

1 answer to this question.

0 votes

In the frame, you can use the JLabel object to display plain text. Example:

JFrame f=new JFrame("Login");

JTextField user = new JTextField();

user.setBounds(110, 15, 200, 30);

f.add(user);
answered Aug 27 by Kyle

Related Questions In Java

0 votes
1 answer

How to get text from text box in Swing?

You can add a Button listener here. ...READ MORE

answered Aug 27 in Java by Jishan
23 views
0 votes
1 answer

Handling empty input in swing text box

login_but.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ //System.out.print(F_user.getText()); String username ...READ MORE

answered Aug 27 in Java by Nila
16 views
0 votes
2 answers

How to create a 2-D array in java?

int[][] multi = new int[5][]; multi[0] = new ...READ MORE

answered Jul 16, 2018 in Java by Daisy
• 8,050 points
42 views
0 votes
2 answers

How can I create File and write data in it using Java?

import java.io.BufferedWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public class WriteFiles{ ...READ MORE

answered Jul 26, 2018 in Java by samarth295
• 2,190 points
91 views
0 votes
1 answer

revalidate() vs repaint() in Java Swing

You need to call repaint() and revalidate() both in order ...READ MORE

answered Sep 19, 2018 in Java by code.reaper12
• 3,450 points
633 views
0 votes
1 answer

Fetching screen resolution using Java

You can fetch the screen resolution using the Toolkit.getScreenSize() method ...READ MORE

answered Sep 20, 2018 in Java by anto.trigg4
• 3,420 points
530 views
0 votes
1 answer

How to change selection listener in JComboBox?

It should respond to ActionListeners, like this: combo.addActionListener (new ...READ MORE

answered Nov 15, 2018 in Java by Frankie
• 9,810 points
68 views
0 votes
1 answer

Describe Heavy Weight Components Mean In Java Programming?

Heavy weight components like Abstract Window Toolkit ...READ MORE

answered Nov 28, 2018 in Java by Frankie
• 9,810 points
41 views
0 votes
1 answer

How to create text labels in Swing, Java?

In the frame, you can use the ...READ MORE

answered Aug 27 in Java by Jimmy
17 views
0 votes
1 answer

Create Buttons in Java Swing

First, you will have to create a ...READ MORE

answered Aug 27 in Java by Esha
15 views