Posts

Showing posts from November, 2018

java font example

Image
Font in java JFrame Example package blogger; import java.awt.*; import javax.swing.JFrame; import javax.swing.JLabel; public class FontExample extends JFrame { JLabel l1; JLabel l2; JLabel l3; Container c=this.getContentPane(); FontExample() { setBounds(0,0,500,300); //==================================================================== Font f1 = new Font("Courier", Font.PLAIN, 18); Font f2 = new Font("Dialog", Font.BOLD, 30); Font f3 = new Font("TimesRoman", Font.ITALIC+Font.BOLD, 12); l1=new JLabel("\"Courier\", Font.PLAIN, 18"); l1.setFont(f1); l2=new JLabel("\"Dialog\", Font.BOLD, 30"); l2.setFont(f2); l3=new JLabel("\"TimesRoman\", Font.ITALIC+Font.BOLD, 12"); l3.setFont(f3); //================================================================== l1.setBo

File handling in java

Image
How to Learn File handling in java   (After this we will be no search further)              I think to save you from a lot of search and teach you File i/o concept effectively. Right now I'm working on school project for which file handling is very important I searched for video to learn file handling but the following video make my understanding so i decided to share it with you. You should to follow me at the end I am sure  you people will be learned.  LET BEGIN file vs database       Some people think that after coming database file is now of no use but we should to learn file  because use of data base for less data is not efficient for programmer. Following two video will clear this point and file concept. 1-file concept video-1 don't leave me I have a best collection for you. video-2 DON'T HIT LONG VIDEO IT IS BEST FOR UNDERSTANDING! video-3 video-4 video-5 video-6 video-7 So up to these we covered the following class:-

Access modifiers

Image
Access modifiers in java:- Access modifiers  decide that whether the class  ,constructor,member or method will be accessible or not.simply access modifier define the accessibility. There are four types of modifier in java    Access modifier   (     private,     default,    protected and public  )  Non-access modifier.  (   static, abstract, synchronized, native, volatile, transient etc. ) Now we will discuses access modifier only. for your understanding I divide access modifier into to type a. class level modifier <class level > b. member level modifier.<member level> a.class level modifier  -In class level Public and default  modifiers are used. -In class only public modifier are written by-default  default are applied. Public access modifier if we use public key word with class it will be accessible in every where.It has highly scope among all modifier. example //package 1 package accessModifiers; public class Class1 { p