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
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
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 ??
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
Free Java & Python 🎉. Bro you're 💯 😇
College professors hate BroCode but no one can stop him
also: Coding boot camps hate him! lol
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
my favorite code channel
You can used arrays for more shortcut
Regarding the order of frame.setVisible(true) and frame.add(component) , the bug has been fixed .
Superb
how can i change the size of the button. I used setSize() method but no use.
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?
Thank you so much you are a live saver
You're the best youtube prof bro. keep it up!
Thank you for this video many doubts got clear 😊
Great work bro. Please make video for mobile app development
Great explanation thank you
bro you are my hero.....
let's go bro!
I love you sir 😘💖😘💖 your video is very useful n understanding but i have only little bit English 😅
Nice video
Thanks, Bro! ☕ You're awesome!
Bro, this is awesome
Nice, bro.
Great job man... thanks a lot
your amazing thanks for sharing :)
Thank you very MUCHHHHHHHHH!!!!!!!
Thank you for the content
Best teacher
Awesome
Much love ❤
you are awesome
Thank you!
This is the best of all thanks bro code
thanks! very helpful!!!!
Thx, Bro!
Bro is king
respect
Thanks
Thanks.
thanks bro
thank you !
I'm now a fellow bro :)
I think what will be left in the WORLD if your channel never existed!!
god bless you
noice
aunt flow
for the algo
brau
comment
......
Thank you!
thanks bro
Thanks!
thanks bro