import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; public class Main{ public static void main(String[] args) { // Layout Manager = Defines the natural layout for components within a container
// FlowLayout = places components in a row, sized at their preferred size. // If the horizontal space in the container is too small, // the FlowLayout class uses the next available row.
JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(500, 500); frame.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
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
Thank you soooo much for your tutorial, it is so simple and beginner friendly, even me who don't speak fluently english i understood everything. Thank You!!
Learned a lot. Haven’t seen all your videos but would like to see some Java programming projects importing files, adding to sql table and run query to fill out forms etc. Thanks
bro, i used the shortcut to create an object of the JButton but if i want to modify my button using methods how should i call the methods with no name?
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Main{
public static void main(String[] args) {
// Layout Manager = Defines the natural layout for components within a container
// FlowLayout = places components in a row, sized at their preferred size.
// If the horizontal space in the container is too small,
// the FlowLayout class uses the next available row.
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
frame.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
frame.add(new JButton("1"));
frame.add(new JButton("2"));
frame.add(new JButton("3"));
frame.add(new JButton("4"));
frame.add(new JButton("5"));
frame.add(new JButton("6"));
frame.add(new JButton("7"));
frame.add(new JButton("8"));
frame.add(new JButton("9"));
frame.setVisible(true);
}
}
You deserve a subscription)
(Full code)
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.Dimension;
import java.awt.Color;
public class Main{
public static void main(String[]args){
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
//frame.setLayout(new FlowLayout(FlowLayout.TRAILING));
frame.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
frame.add(new JButton("1"));
frame.add(new JButton("2"));
frame.add(new JButton("3"));
frame.add(new JButton("4"));
frame.add(new JButton("5"));
frame.add(new JButton("6"));
frame.add(new JButton("7"));
frame.add(new JButton("8"));
frame.add(new JButton("9"));
frame.add(new JButton("0"));
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(125,125));
panel.setBackground(Color.lightGray);
panel.setLayout(new FlowLayout());
panel.add(new JButton("1"));
panel.add(new JButton("2"));
panel.add(new JButton("3"));
panel.add(new JButton("4"));
panel.add(new JButton("5"));
panel.add(new JButton("6"));
panel.add(new JButton("7"));
panel.add(new JButton("8"));
panel.add(new JButton("9"));
panel.add(new JButton("0"));
frame.add(panel);
frame.setVisible(true);
}
}
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
Thank you soooo much for your tutorial, it is so simple and beginner friendly, even me who don't speak fluently english i understood everything. Thank You!!
i'm in the same situation
@@josesamuel7615 ah mais t'es un français comme moi ??
Thanks 🙏 prof 👨🏫. I had benefited a lot from your previous videos..
thank you for watching Ousman!
Watching my videos helps the channel grow. I appreciate it
You're the best youtube prof bro. keep it up!
Free Java & Python 🎉. Bro you're 💯 😇
my favorite code channel
Awesome! Just waiting for a neural network tutorial in Java
uhhhh I looked into this. I'll admit that it's above my skill level right now lol
@@BroCodez np
@@BroCodez you probably can do it now bro
Learned a lot. Haven’t seen all your videos but would like to see some Java programming projects importing files, adding to sql table and run query to fill out forms etc. Thanks
bro you are my hero.....
Bro, this is awesome
Thank you so much you are a live saver
Superb
Thank you for this video many doubts got clear 😊
College professors hate BroCode but no one can stop him
also: Coding boot camps hate him! lol
Nice, bro.
You can used arrays for more shortcut
Thanks, Bro! ☕ You're awesome!
Great work bro. Please make video for mobile app development
Great job man... thanks a lot
Thank you for the content
Great explanation thank you
let's go bro!
Much love ❤
I love you sir 😘💖😘💖 your video is very useful n understanding but i have only little bit English 😅
your amazing thanks for sharing :)
This is the best of all thanks bro code
Nice video
Thank you!
Best teacher
Thank you very MUCHHHHHHHHH!!!!!!!
you are awesome
Awesome
Thx, Bro!
bro, i used the shortcut to create an object of the JButton but if i want to modify my button using methods how should i call the methods with no name?
thanks! very helpful!!!!
thank you !
how can i change the size of the button. I used setSize() method but no use.
Bro is king
Regarding the order of frame.setVisible(true) and frame.add(component) , the bug has been fixed .
thanks bro
Thanks.
Thanks
respect
I'm now a fellow bro :)
god bless you
I think what will be left in the WORLD if your channel never existed!!
noice
aunt flow
for the algo
brau
comment
......
Thank you!
thanks bro
Thanks!
thanks bro