import java.awt.GridLayout; 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
// GridLayout = places components in a grid of cells. // Each component takes all the available space within its cell, // and each cell is the same size. JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(500, 500); frame.setLayout(new GridLayout(3,3,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
how grid layout tends to fill component in a frame? like when we use 9 component and a grid layout of(3,3) then it creates 3 row and 3 column but when we use 10 component and grid layout of(3,3) then it creates 3 rows 4 column . why ?? please explain.
import java.awt.GridLayout;
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
// GridLayout = places components in a grid of cells.
// Each component takes all the available space within its cell,
// and each cell is the same size.
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
frame.setLayout(new GridLayout(3,3,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);
}
}
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
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 GridLayout(1,10,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"));
frame.setVisible(true);
}
}
My teacher used your video to teach us, and i have to say,
He picked a good video. You did a really good job!
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
bro's teaching generations to code for free,
He's definitely going to heaven.
just dropping a comment, these guides still are amazing
Thanks for lessons. You are the best teacher
Nice,easy to catch for beginners
simple easy an making me pass the test, thanks bro bro
Thanks for the video!
you're a life saver fr!! thank u king
Its just like css grids. Thanks for the video man.
Nice, bro!
I learned something new, thanks
how grid layout tends to fill component in a frame?
like when we use 9 component and a grid layout of(3,3) then it creates 3 row and 3 column but when we use 10 component and grid layout of(3,3) then it creates 3 rows 4 column . why ?? please explain.
I am looking for some JavaFX projects to learn from and practice
спасибо бро, я не понимаю инглишь, но все равно все понял, что ты показал
Nice video
thankyou for the explanation, you helped me good xx
thank you bro .. keep it up
Yo.. I smashed the like button.
so useful, thanks.
Bro if simple was a person I could say is you ❤
great channel bro keep going
Hey Bro thanks for sharing , your doing great job :)
What a small World, hi😅😅
@@Dilgash. really ? Are you Dr. Dilgash ? 😃
Thank you!
Petition for bro code to add memes in his videos.
You don't need a petition, you can just ask lol. Yea sure, I like memes
How to add a label on top?
👌👌👌👌👌
nice video, but wouldn't be possible using a for loop for the buttons?
you're great man!
broCode is the man!
Perfect Bro and...
How to add border??
great!!
the best video tutorial👍
Thank You Bro!
why writing when you can do it on the swing interface graphic? seems you are just copying
grid and bear it?
Liked commented subscribed
a good video!
Thank you.
👍👍👍
Lifesaver for sure
thanks dude
thank u dude. i wanna reach u. how can i contact u. pls gimme a mail
thank you for the content
thanks!
thanks bro
thanks bro... .
brillant xx
Thanks
Thx for the vid
Thankww so much 😊
Its just perfect
Dropped comment
thank you :D
please make ludo game in java
adamsin bro
comment
Hello Guys im a guy (C:
Thanks