Back to Browse

Java Bangla Tutorials 13: How to Change color font style and font size in Java Project (GUI)

903 views
Mar 27, 2017
2:49

#javaprogramming #java #programminglanguage Java Bangla Tutorials 13: How to Change color font style and font size in Java Project (GUI) In this video tutorial we are going to learn how to change font color, font style and font size in java Application (GUI) in NetBeans Introduction (50 words) Hello everyone, I'm [name here] and in this tutorial I will be showing you how to change the colour, font style and font size in your Java GUI project. Often times, when coding a simple program, you want to be able to set different attributes such as the font, colour and font size in order to make your program look presentable to the viewer. In this video, I'll show you how to easily make this happen in your Java project. So without further ado, let's get started. Step 1: Setting the Font Color (50 words) The first step of changing the font color in your Java project is to get your desired color as an integer number. This can be done by writing this line of code - "int color = your color's number" - and plugging in the appropriate number for the colour of your choice. So, for instance, if you want the font to be red you'd use the color number "#FF0000", and if you wanted it to be blue you'd use the color number "#0000FF". Step 2: Setting the Font Size (50 words) Now you will want to set the size of the font in your Java project. To do this you'll use the "Font" class, which can be imported from the Java library. Once imported, you can create a new object of type "Font" in which you can specify the font's size, style and weight. The syntax for calling the "Font" class looks like this - "Font font = new Font (name of font, style, size)". Step 3: Setting the Font Style (50 words) Lastly you'll want to set the style of the font in your Java project. To do this you'll need to use the "Font" class again, but this time you'll be using a different method. This method is called "setStyle" and it takes in one parameter which specifies the style of the font. You can use some of the pre-made options such as "Bold" or "Italic" or you can create your own custom font style with the "Font.createFont" method. Conclusion (50 words) To recap, in this tutorial I have shown you how to easily change the colour, font style and font size in your Java GUI project. I started ✅Subscribe to my other channels. A subscriptions from you really means a lot to me. 🔴 Binary Pathshala: https://www.youtube.com/c/binarypathshala 🔴 MH Abid https://www.youtube.com/c/mhabid 🔴 That's Inspiring!: https://www.youtube.com/channel/UCnzpaw192xYBtpkm42ICHjg 🔴 Abid -The Tech Doctor : https://www.youtube.com/channel/UCsjvB1Bm-D-rePu-JDlNn8Q ✅ website: https://www.abidacademy.com ✅Facebook Page: https://www.facebook.com/mh1294/ ✅Facebook Page: https://www.facebook.com/binarypathshala ✅Instagram profile: https://www.instagram.com/mh_1294/ Please comment below your opinion how to do you want us to make video tutorial Tags: how to change font size in eclipse,how to change font size in netbeans ide,how to change font color in eclipse,font,netbeans font size change,font size change,change netbeans font size,change font size,font size,how to change font in netbeans,how to change font size and color theme in eclipse ide,netbeans font size,font style,eclipse change font size,how to change font style in netbeans ide,how to change font size in eclipse java #javaprogramming #java #programminglanguage #banglatutorial #binarypathshala #java #javafullcourse

Download

0 formats

No download links available.

Java Bangla Tutorials 13: How to Change color font style and font size in Java Project (GUI) | NatokHD