Java panels 🟥

preview_player
Показать описание
Java GUI panel JPanel swing tutorial for beginners

#Java #panel #jpanel #GUI #swing #tutorial #beginners
Рекомендации по теме
Комментарии
Автор

import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class Main {

public static void main(String[] args) {

// JPanel = a GUI component that functions as a container to hold other components
ImageIcon icon = new ImageIcon("thumbsup.png");

JLabel label = new JLabel();
label.setText("Hi");
label.setIcon(icon);


//label.setBounds(100, 100, 75, 75);

JPanel redPanel = new JPanel();

redPanel.setBounds(0, 0, 250, 250);
redPanel.setLayout(new BorderLayout());

JPanel bluePanel = new JPanel();

bluePanel.setBounds(250, 0, 250, 250);
bluePanel.setLayout(new BorderLayout());

JPanel greenPanel = new JPanel();

greenPanel.setBounds(0, 250, 500, 250);
greenPanel.setLayout(new BorderLayout());

JFrame frame = new JFrame();

frame.setLayout(null);
frame.setSize(750, 750);
frame.setVisible(true);
greenPanel.add(label);
frame.add(redPanel);
frame.add(bluePanel);
frame.add(greenPanel);
}
}

BroCodez
Автор

bro the way you explain these concepts is so good....thank you so much for the videos they really help a lot!!

omark
Автор

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 don't skip the ads so u can have the revenue u deserve <3

bitcoin
Автор

I liked the video and I subscribed but, I still don't know how you find the energy to prepare these videos with that small amount of views. You are incredible

ItamiPlaysGuitar
Автор

Op explain bro thnx for sharing khowledge in such way

travel_to_wonders
Автор

Bro, I literally started learning how to make GUIs in java yesterday and you upload this

You're awesome

bruce
Автор

Great job breaking it down. Thanks man!

stephendavol
Автор

Great video! I did this myself and used a much larger *.PNG photo. I struggled quite a bit to resize it (to make it smaller), but if anyone wants to know the code here's how, you'll figure out where to place it. Love these videos. Great to work through things yourself.

ImageIcon icon = new ImageIcon("wind.png");
Image scaleImage = icon.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);
icon = new ImageIcon(scaleImage);

AdrianTregoning
Автор

This video is so informative. Thank you for the hard work

TheRickyfranco
Автор

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

dianamilenaarchilacordoba
Автор

I read that it is recommended to use JPanel for background image, hope you create a tutorial on that

liaMXWolfGaming
Автор

Heeeey, bro! This video is the best that i ever seen! Like. I tried to use Jpanel with JFrame for a long time. Great video! I love you XD.

ИльяТребоганов-йх
Автор

liking and commenting since this vid was helpful

Demajaasa
Автор

thanks, and I appreciate your hard work.

mudassirnaz
Автор

Where are the other jpanel related videos? Is there a playlist? Would love to watch more

jaymob
Автор

Thank you my friend! You help me so much!!!!

GbrielLirio
Автор

Muchas gracias, estoy aprendiendo apenas y tú video me ayudó bastante, muy claro todo 😁

carloseduardosabbaghfranqu
Автор

Thank you for all the tutorials bro. I have a question, is coding java swing components the same as designing it from a JFrame form? do you also have tutorials on swing Events?

When creating a program/app do you prefer coding the whole thing or designing it and then coding events?

carlosllige