Java BorderLayout 🧭

preview_player
Показать описание
Java, borderlayout, layout, manager, swing, GUI, tutorial, beginners,
#Java #borderlayout #manager #layout #GUI #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

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

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.JFrame;

public class Main{

public static void main(String[] args) {

// Layout Manager = Defines the natural layout for components within a container

// 3 common managers

// BorderLayout = A BorderLayout places components in five areas: NORTH, SOUTH, WEST, EAST, CENTER.
extra space is placed in the center area.

JFrame frame = new JFrame();

frame.setSize(500, 500);
frame.setLayout(new BorderLayout(10, 10));
frame.setVisible(true);

JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
JPanel panel3 = new JPanel();
JPanel panel4 = new JPanel();
JPanel panel5 = new JPanel();







panel5.setLayout(new BorderLayout());

panel1.setPreferredSize(new Dimension(100, 100));
panel2.setPreferredSize(new Dimension(150, 100));
panel3.setPreferredSize(new Dimension(150, 100));
panel4.setPreferredSize(new Dimension(100, 100));
panel5.setPreferredSize(new Dimension(100, 100));

sub panels

JPanel panel6 = new JPanel();
JPanel panel7 = new JPanel();
JPanel panel8 = new JPanel();
JPanel panel9 = new JPanel();
JPanel panel10 = new JPanel();







panel5.setLayout(new BorderLayout());

panel6.setPreferredSize(new Dimension(50, 50));
panel7.setPreferredSize(new Dimension(50, 50));
panel8.setPreferredSize(new Dimension(50, 50));
panel9.setPreferredSize(new Dimension(50, 50));
Dimension(50, 50));

panel5.add(panel6, BorderLayout.NORTH);
panel5.add(panel7, BorderLayout.SOUTH);
panel5.add(panel8, BorderLayout.WEST);
panel5.add(panel9, BorderLayout.EAST);
panel5.add(panel10, BorderLayout.CENTER);

sub panels

frame.add(panel1, BorderLayout.NORTH);
frame.add(panel2, BorderLayout.WEST);
frame.add(panel3, BorderLayout.EAST);
frame.add(panel4, BorderLayout.SOUTH);
frame.add(panel5, BorderLayout.CENTER);
}
}

BroCodez
Автор

Lucky that I found your channel 10/10 for mic quality and content

ShrihariNBhat
Автор

Im supporting my main training in Java with your vids. Awesome courses, i love the way of your explaining things. Keep it up bro =)

oguzhankantarc
Автор

Glad I found your channel as a amateur, still learning Java programmer.

deepeshsingh
Автор

Hi, you really help me to understand borders. Spending half of my day understanding this without any help and I finally found this. Great work!

markpaycol
Автор

brocode you always save me in every single new programming concept i want to learn you are very amazing

rolakhaled
Автор

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
Автор

great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much

dianamilenaarchilacordoba
Автор

Thanks man...I don't know how to say this but I've solved a huge problem because of you...

parindyapigera
Автор

I love the way of your explaining things.And you help me a lot.
Thx u bro
Keep it up bro

qaisayyash
Автор

Glad I found your channel, great tutorial :)

blabberq
Автор

Hey Bro... you are the best... never stop doing this awesome job : D

elvispontes
Автор

Can you also make a tutorial about Java BoxLayout?
It seems after surfing the web, yours is the only cleanest and the most understandable code I can read.

chriscentproductions
Автор

Kaip visada įdedi daug darbo ir gerai paaiškini <3

Simis
Автор

Hey, love your video, it's very good for my learning. thank you so much :)

elod
Автор

Great work bro. Please make videos for mobile app development....

kaushalprasadyadav
Автор

👌, I bet tomorrow we're animating them 🙏

monwil
Автор

There are no words to express how awesome these videos are!

reptileita
Автор

Thank you very much for the 12hr tutorial. I am having a issue with panel 6-10 . The north south east west cernter doesn't seem to be working. I did panel5.add(panel6, BorderLayout.NORTH).... Can you tell me why🤔

preciousmatos