import java.awt.Color; import javax.swing.ImageIcon; import javax.swing.JFrame; public class Main { public static void main(String[] args) { // JFrame = a GUI window to add components to JFrame frame = new JFrame(); //creates a frame frame.setTitle("JFrame title goes here"); //sets title of frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //exit from application frame.setResizable(false); //prevent frame from being resized frame.setSize(420,420); //sets the x-dimension, and y-dimension of frame frame.setVisible(true); //make frame visible ImageIcon image = new ImageIcon("logo.png"); //create an ImageIcon frame.setIconImage(image.getImage()); //change icon of frame frame.getContentPane().setBackground(new Color(0x123456)); //change color of background } }
@@sudharshan_reddy_kakarla the funny thing is that i was looking at your comment trying to figure out if it was a java refrence or not, then i noticed my typo lmao Yea i would import and use the "java.😂.lava" class in my code too lol
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
@@BroCodez I wonder if you can do this same type of tutorial series for C# / .NET; Now, I won't be able to utilize .NET6 (i.e., the latest available standard of the .NET framework) for quite some time, but as far as .NET 5 goes, that will be totally applicable.
Becareful what you choose to highlight when you apply that change to your targeted word. Make sure you dont have any place where it should stay the same highlighted. Good tip tho!
I have a problem, my eclipse doesn't suggest component class methods (that is usable to other objects) like .setSize(), .setVisible(), and much more. How do i fix this? i really don't want to use intelliJ :(
Isn’t it awesome that we can simply ask AI our questions now and get immediate tailored personalized answers? I still find it miraculous. To answer yours: I cant say with 100% certainty, but it might be something that needs enabled in settings/preferences… although hopefully by 2 years youve long since found the solution lol
Hey, I'm just learning coding but I saw your reply to someone else. Is learning Swing a waste of time now that it's becoming outdated? Should I focus my time on learning JavaFX instead? Java is my first language.
hey bro, at the very end when we created the instance of myframe in main, if we wish to change or add some extra jframe property to the frame, can we do that from main itself or we have to go back to myframe class?
Hey bro i am 15 yrs old and i have learned.. c, c#, html, css, java script. ..and i have watched most of your java videos.. but I am not quiet comfortable with java.. i dont feel that i have understand and ready to build app in java.. but i have created.. 3 games with c# and unity.. do you have some solutions?
I encountered some problem, mine does not produce any window instead only say... "Exception in thread "main" java.lang.UnsatisfiedLinkError: no awt in system library path:" and so on, Any way to fix this? Thank you.
import java.awt.Color;
import javax.swing.ImageIcon; import javax.swing.JFrame;
public class Main {
public static void main(String[] args) {
// JFrame = a GUI window to add components to
JFrame frame = new JFrame(); //creates a frame
frame.setTitle("JFrame title goes here"); //sets title of frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //exit from application
frame.setResizable(false); //prevent frame from being resized
frame.setSize(420,420); //sets the x-dimension, and y-dimension of frame
frame.setVisible(true); //make frame visible
ImageIcon image = new ImageIcon("logo.png"); //create an ImageIcon
frame.setIconImage(image.getImage()); //change icon of frame
frame.getContentPane().setBackground(new Color(0x123456)); //change color of background }
}
Well understand, thank you so much
Best java tutorial playlist on TH-cam, I want to thank for what you've done, keep up good work!
"Let's set the size by 420 to 420 because that's a funny number." LMAO. This had me laffin.
Man, i wish everyone whos lookin to learn lava finds this channel! Its just absolutely the best!
It's Java . 😂.lava
@@sudharshan_reddy_kakarla the funny thing is that i was looking at your comment trying to figure out if it was a java refrence or not, then i noticed my typo lmao
Yea i would import and use the "java.😂.lava" class in my code too lol
I am really glad that I find your youtube channel. You are saviour man
Never got this idea of using subclass of JFrame instead of repeating the same code several times in different projects. Thanks Bro.
This is also a nice way to understand the keyword this. Keyword this basically just pretends to be an instance of the class in which you are in.
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
I really like the way your patience of explaining.
very fun very interactive lessons as well as structural knowledge, love it man 👍
Bro keep this up, i really like your way of explaining everything. I just began to code, your videos will guarantee me a job in the future :)
Honestly thank you so much, my java skill got improved by watching you
the best tutorial
Thank you Bro for sharing this video.
You are great, these videos are precious. Thank you bro.
You are carrying my friend and I in our java comp sci class, THANK YOU!!!
great video!!! I'm infinitely grateful for your dedication and big heart to share this knowledge with the world. Thank you soo much
Helping you, to keep helping me ⛈
best ever tutorial i've ever watch, thank you Bro Code
Please Make Tuturial For JAVAFX
why are you such a chad? Thanks bro!
That "Twitch Purple" is actually 0x7B3296 in Hexadecimal, if anybody was curious as to the hex equivalent.
nice!
@@BroCodez I wonder if you can do this same type of tutorial series for C# / .NET; Now, I won't be able to utilize .NET6 (i.e., the latest available standard of the .NET framework) for quite some time, but as far as .NET 5 goes, that will be totally applicable.
Nice job, man! I like your tutorials too much. Congratulations for the beautiful job!
❤️Superb, good explanation, keep it up. 👏👍👌
Bro I recommended ur videos to my classmates they like it.
Thank you rene!
man im so like your video!! thanksss
Thank You for ease the information.
Becareful what you choose to highlight when you apply that change to your targeted word. Make sure you dont have any place where it should stay the same highlighted. Good tip tho!
helped me with my cs30 class legend
I am loving this channel.
Bro is our shining star in the middle of the night
Thank you for teaching this to us. The time you put into these videos really shows :)
splendid
Thank you for this video
RESPECT TO WHAT YOU DO BIG THANK YOU FOR YOU
dude+just+wooow
great
Thank you sooooo much for all the videos
Cool
I thought starting GUI would be boring but guess what, I like this!!!
Thank You
I have a problem, my eclipse doesn't suggest component class methods (that is usable to other objects) like .setSize(), .setVisible(), and much more. How do i fix this? i really don't want to use intelliJ :(
Isn’t it awesome that we can simply ask AI our questions now and get immediate tailored personalized answers? I still find it miraculous. To answer yours: I cant say with 100% certainty, but it might be something that needs enabled in settings/preferences… although hopefully by 2 years youve long since found the solution lol
no way, it can't be this easy.. no way
We will support you.... Keep rocking broooo😎
Thank you so much really for your effort
Thanks
thks
awesome content actually, and it helped me a lot cause i wasn't finding any place to study it easily
ty bro
THANKS
Hey you yeah I'm talking to you ! You r the best 🙏❣️
bravo
you are great. please make videos for mobile app
Thank you very much brother!This is really helpfull!Keep it up ur good work!Solve my a lot of questions!
Another excellent video, Bro. Thanks. BTW, proud subscriber here.
Hey, I'm just learning coding but I saw your reply to someone else. Is learning Swing a waste of time now that it's becoming outdated? Should I focus my time on learning JavaFX instead? Java is my first language.
so very good
high quality
Thanks for another great vid
thanks
thank you
thank you bro my hero
I'm assuming you can't do this with an online java compiler
*_cool_*
Bro you are too good .... You are best than my college teachers 💓💗
You are amazing
this has helped me a great deal
Thank you bro!
Amazing! Thank you very much sir!
🙉🙉 i really like the brocode did it
i have a question bro how do you know which method to use for example setIconImage(). how to know where and which method i should use??
Google it
Thankssss for this one
Thanks!
thanks bro
Thank you so much sir.
Great!
Dope video
Thanks G!
Thank you, that was amazing lesson :D
thx
I have a problem here, when i put a specific height and width for some reason the window opened is smaller
Thanks, Bro! ☕ You're awesome!
This series is great!
thanks!
this.setLocationRelativeTo(null); //center frame
hey bro, at the very end when we created the instance of myframe in main, if we wish to change or add some extra jframe property to the frame, can we do that from main itself or we have to go back to myframe class?
this feels like HTML/CSS coding
Thanks bro code!!! Keep it up. I'm actually going to look forward to you.☺🍫
Does anyone know why there is no logo when I copy the exact code above and also put a 16x16 png file named logo.png in the src-folder??☹
Can you help me with GridBagLayout?
Best account on youtube
what happens if I make two or more frames ??
also my setBounds() method isn't working.I set Layout to null
Hey bro i am 15 yrs old and i have learned.. c, c#, html, css, java script. ..and i have watched most of your java videos.. but
I am not quiet comfortable with java.. i dont feel that i have understand and ready to build app in java.. but i have created.. 3 games with c# and unity.. do you have some solutions?
My opinion is that, Java FX is better for developing applications than Swing, that would be a good next step for you
@@BroCodez thanks for your suggestion
Are you doing well 👀❤
@@YTSHANKYare you doing well ❤
@@nethminaashen6201 yup doing good, currently doing bachelor's in computer science
Thanks man
I encountered some problem, mine does not produce any window instead only say...
"Exception in thread "main" java.lang.UnsatisfiedLinkError: no awt in system library path:" and so on,
Any way to fix this? Thank you.
Thanks Bro!
I will never call G.U. I. As GOO WEE
6:26 Why did they put a set method inside a get method?
why do we have to replace frame with this? i dont understand it
This is really epic! hahah
I dont think so
@@jjbigelow4522 you obviously are a little beta programmer who sits in his moms basement all day punching away at the keys. BRO CODE IS EPIC >:(
Love you Bro,
Cheers Bro
can we put hexadecimal colors in java?
yes 0x000000