Java textfield 📛

preview_player
Показать описание
Java, textfield, JTextField, GUI, swing, tutorial, beginners,

#Java #textfield #JTextField #GUI #swing #tutorial #beginners

Coding boot camps hate him! See how you can teach you to code with this one weird trick...

Drop a comment down below and subscribe if you'd like to become a fellow bro.

This is a tutorial channel for beginners to learn how to code.

A few languages I plan on covering include, but are not limited to:

Python
Java
C#
C++
C
Javascript
HTML
CSS
Django
MySQL

and more probably...maybe

¯\_(ツ)_/¯
Рекомендации по теме
Комментарии
Автор

//
public class Main{

public static void main(String[] args) {


// JTextField = A GUI textbox component that can be used to add, set, or get text

new MyFrame();
}
}
//
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;

public class MyFrame extends JFrame implements ActionListener{

JButton button;
JTextField textField;

MyFrame(){

this.setLayout(new FlowLayout());

button = new JButton("Submit");


textField = new JTextField();
Dimension(250, 40));
textField.setFont(new Font("Consolas", Font.PLAIN, 35));
textField.setForeground(new Color(0x00FF00));





this.add(button);
this.add(textField);
this.pack();
this.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==button) {
"+ textField.getText());


}

}
}
//

BroCodez
Автор

I'm surprised, because I learning Java and you channel is the one of bests in YouTube, tank you so much for this! I'm Brazilian and love your videos bro!!

carlosarruda
Автор

This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro

pavelkvasnicka
Автор

I've been watching this series and honestly im surprised these videos dont have more likes. you do a good job at explaining this stuff and making it easy to understand. im having a problem where setting the text of the textfield is making everything disappear and i cant figure out why. heres my code for the textfield

package notHomework;


import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JTextField;

public class TextFieldList extends JTextField {
TextFieldList(int width, int height, String[] notes) {
this.setPreferredSize(new Dimension(width, height));
String text = "";

for(int i = 0; i < notes.length; i++) {
text = text + notes[i] + "\n";
}
System.out.println(text);
this.setText(text);
}
}

justinknew
Автор

Bro, thank you, ur videos r the best I have ever seen, Good luck, I will inform all my friends about your channel

abdumalikumarov
Автор

Hi Bro! I am a CS student and you have been the best teacher.THANK YOU! You are AWESOME!

m.uzairsadiq
Автор

I've watched so many of your videos and they have all helped me out so much!! Thank you

brianheeley
Автор

just saying, I was here before 10K, 25K, 50K, 100K, 500K and 1M!

winterSweet-km
Автор

THANK YOU THAT WAS WAY MORE BENEFICIAL AND I DO ADMIRE YOUR WAY OF TEACHING♥

bassantahmed
Автор

Good stuff! This was super helpful & well explained 👍. Your the best 😊

easytogit
Автор

Can you do a video for how to validate user name and age ? Like they can only have alphabet and valid characters, and age can only be digits 0-100 years okd

stefanmilinkovic
Автор

Subscribed and liked Mr.Bro Code! If you could upload some ideas about the Mini-project at University level. For pre-testing, we have bus reservation project. So if you would help me out about this.

birandai
Автор

Thank you 🙏, this video is very helpful

ميسوائلمحفوظغيث
Автор

You are so useful, absolute alpha chad bro

cedricpulmano
Автор

Thank you thank you thank you, guys say thank you to get this awsome channel more views. Because...this is what Bros do🤜

superTramp
Автор

Nice and Easy to understand Video :D Thank you

DrinkableWater
Автор

Hi! how are you

I want a way to hide the text that is in a text field, if possible

aymen_abush
Автор

What is the difference between setSize and setPrefferedSize methods

akshaykumarsharma