Study Viral (Java Tutorials For Beginners - Step By Step)
  • Home
  • Java Tutorials
    • Core Java
    • Java Swing
    • MS Access JDBC Java Application
  • Facebook Page
  • Programs
    • C Programs
    • C++ Programs
    • Java Programs
    • Python Programs
  • UGC NET
  • Home
  • Java Tutorials
    • Core Java
    • Java Swing
    • MS Access JDBC Java Application
  • Facebook
  • Programs
    • C Programs
    • C++ Programs
    • Java Programs
    • Python Programs
  • UGC NET

Java Swing (GUI) Use of JTable from JTextFields - Study Viral

 December 18, 2017     Java Swing     No comments   


Java Swing (GUI) Use of JTable from JTextFields - Study Viral 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Tutorial - 29 Methods in Java - StudyViral

 December 18, 2017     Java Tutorials     No comments   


Java Tutorial - 29 Methods in Java - StudyViral

A method is a set of code which is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method's name.
Methods allow us to reuse the code without retyping the code.

The only required elements of a method declaration are the method's return type, name, a pair of parentheses, () , and a body between braces, {} .

The only required elements of a method declaration are the method's return type, name, a pair of parentheses, (), and a body between braces, {}.
More generally, method declarations have six components, in order:
  1. Modifiers—such as public, private,protected
  2. The return type—the data type of the value returned by the method, or void if the method does not return a value.
  3. The method name—the rules for field names apply to method names as well, but the convention is a little different.
  4. The parameter list in parenthesis—a comma-delimited list of input parameters, preceded by their data types, enclosed by parentheses, (). If there are no parameters, you must use empty parentheses.
  5. An exception can be part of method header section after parentheses () and before opening brace {.
  6. The method body, enclosed between braces—the method's code, including the declaration of local variables, goes here.
 
Example :

public class DemoMethods {

    //declaration of method
    public static void myMethod() {
        System.out.println("Hye it's my method");
    }
    //declaration of method
    public void myMethod1() {
        System.out.println("Hye now i need Object to call this method");
    }
   
    public static double adding1(double a, double b) {
        double c = a+b;//30
        return c;
    }
    //declaration of method
    public int adding2(int a,int b,int c) {
        int d = a+b+c;//17
        return d;
    }
   
    public static void main(String[] args) {

        myMethod();//calling
        DemoMethods dm = new DemoMethods();
        dm.myMethod1();
        System.out.println("Retutn double :: "+adding1(10.0,20.0));
        System.out.println("Retutn int :: "+dm.adding2(5,4,8));       
    }
}
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Tutorial - 28 Constructor in Java - StudyViral

 December 17, 2017     Java Tutorials     No comments   

Java Tutorial - 28 Constructor in Java - StudyViral

 Constructors

In Java Constructors are special methods which has the same name as class name.

 It also helps to initialize the object of a class.

The new operator is used with constructor.

If we don't specify constructor than java compiler automatically provide it, we can also say Constructor is implicitly called by Java Compiler.

Constructor don't have return type.

 There are two type of constructors in java.

1). Default constructor.

2). Parameterized Constructor. 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Swing Tutorial - Create Animated Splash Screen - Study Viral

 December 17, 2017     Java Swing     No comments   

Java Swing Tutorial - Create Animated Splash Screen - Study Viral

 

 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Swing Tutorials (GUI) - Read and Write JList with Text File - Study Viral

 December 17, 2017     Java Swing     1 comment   


Java Swing Tutorials (GUI) - Read and Write JList with Text File - Study Viral

In this video I am going to show You

1). Write data from JList to text file

2). Load/Add data to JList from text file

There are number of classes we can use
For this video we need


Save To File
we can use FileWriter but the problem is it don't allow new line character
BufferedWriter is used to read data
but i am using PrintWriter to write on text file because it has println()


Read From File
FileWriter - makes it possible to read the contents of a file as a stream
of characters.

BufferedReader - that reads text from a character-input stream,
buffering characters so as to provide for the efficient reading of
characters, lines and arrays.

 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Swing (GUI) - Update JList Data - Study Vira

 December 17, 2017     Java Swing     No comments   



Java Swing (GUI) - Update JList Data - Study Viral


In this video i am updating JList on runtime
after add data we select data from jlist

Now Update Selected Value from jtextfield to jlist
This thing add extra element to list
Now we need to remove selected index element also

Please Do Subscribe my Channel
Have A Nice Day :D

 

 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java GUI - JList (Java Swing) Using Netbeans Part 02 - Study Viral

 December 17, 2017     Java Swing     No comments   


Java GUI - JList (Java Swing) Using Netbeans Part 02 - Study Viral

Now the Coding Part
1. Close button and Minimize Button
2. Button Color on Mouse Entered & Exit
3. Add button Code to add data to list
4. Simple click operation on jtextfield to clear msg
5. Increase Counter
6. Remove Data but before that we need to find index of jlist data which we
going to remove for that click operation on jlist
7. Now Remove data only when user select data from list
 

 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java GUI - JList (Java Swing) Using Netbeans Part 01 - Study Viral

 December 17, 2017     Java Swing     No comments   

Java GUI - JList (Java Swing) Using Netbeans Part 01 - Study Viral

 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java GUI - Count Down Timer (Java Swing) Using Netbeans - Study Viral

 December 17, 2017     Java Swing     2 comments   


Java GUI - Count Down Timer (Java Swing) Using Netbeans - Study Viral

 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Tutorial - 27 Class & Objects in Java - StudyViral

 December 17, 2017     Java Tutorials     No comments   


Java Tutorial - 27 Class & Objects in Java - StudyViral

 Class
A class is a user defined prototype or blueprint from which objects are created.
We can also say class is collection of data members and member functions/methods.
where data members are variable and member functions/methods are used to access
data members.
Keyword: class

Note: Every Single Java file can have only single/one public class.
We can't have two or more class as public within single java file.


Object
Objects are instance of class. In other words object reference are memory locations
where object data is saved.
Object of predefined or user defined classes can be created by using new operator.


Constructor
Constructors are special method which has same name as that of class name.

 class Student{
    String name;//data members
    int rollno;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getRollno() {
        return rollno;
    }
    public void setRollno(int rollno) {
        this.rollno = rollno;
    }
    //2 Member Functions
    public void sleep() {
        System.out.println(name+" "+rollno + " is Sleeping" );
    }
    public void study() {
        System.out.println(name+" "+rollno + " is Studing" );
    }
}

public class DemoClassObject {

    public static void main(String[] args) {
        Student s1;//s1 is object of Student Class
        s1 = new Student();//Initialize
              
        s1.setName("Hardeep");
        s1.setRollno(101);
        System.out.println("Name :: "+s1.getName());
        System.out.println("Rollno :: "+s1.getRollno());
        s1.sleep();
        s1.study();
    }
}

 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Facebook

StudyViral

Labels

Alphabet Pattern Binary Tree BLOB (Binary Large Object) Computer Networks Computer Science And Applications Paper-II Data Structure DBMS Digital Clock Digital Watch Extra Tutorials File Upload Find Age from Date of Birth Graph-Algorithms Java and J2EE web applications JAVA JDK 12 Java Mail API Java MySQL Java Programs Java Programs List Java Servlets Java Swing Java Swing With MySQL Database Java Tutorials JCalender KVS Compuer Science - January 2017 Question Paper MS Access JDBC Java Application Multiuser Login NETBEANS 11 IDE Occurrence of Digits in Number Operation System Pattern Program Reverse of String Sending Email Servlet Servlet Tutorial Software Engineering Star Struts 2 FrameWork Struts 2 Registration Form UGC NET JULY 2018 Windows Commands

Popular Posts

  • Create CON, AUX, NUL name folder and files in Windows - Study Viral
    Create CON, AUX, NUL name folder and files in Windows - Study Viral Most of you may be aware of many MS-DOS commands but still n...
  • UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 26)
    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 26) Q 26. A binary search tree in which every non-leaf node...
  • Java Swing Application for Sending E-Mail - StudyViral
    Java Swing Application for Sending E-Mail - StudyViral Hello Friends Welcome to StudyViraL Channel In this video I am going...

Categories

  • Alphabet Pattern (13)
  • Binary Tree (2)
  • BLOB (Binary Large Object) (1)
  • Computer Networks (2)
  • Computer Science And Applications Paper-II (40)
  • Data Structure (6)
  • DBMS (1)
  • Digital Clock (1)
  • Digital Watch (1)
  • Extra Tutorials (3)
  • File Upload (1)
  • Find Age from Date of Birth (1)
  • Graph-Algorithms (1)
  • Java and J2EE web applications (3)
  • JAVA JDK 12 (1)
  • Java Mail API (3)
  • Java MySQL (5)
  • Java Programs (44)
  • Java Programs List (3)
  • Java Servlets (3)
  • Java Swing (16)
  • Java Swing With MySQL Database (4)
  • Java Tutorials (37)
  • JCalender (1)
  • KVS Compuer Science - January 2017 Question Paper (6)
  • MS Access JDBC Java Application (6)
  • Multiuser Login (1)
  • NETBEANS 11 IDE (1)
  • Occurrence of Digits in Number (1)
  • Operation System (4)
  • Pattern Program (8)
  • Reverse of String (2)
  • Sending Email (1)
  • Servlet (3)
  • Servlet Tutorial (3)
  • Software Engineering (4)
  • Star (7)
  • Struts 2 FrameWork (2)
  • Struts 2 Registration Form (1)
  • UGC NET JULY 2018 (40)
  • Windows Commands (2)

Pages

  • Java Tutorials
  • ASP.NET (in Hindi)
  • Java Programs List

Blog Archive

  • ►  2021 (3)
    • ►  April 2021 (3)
  • ►  2019 (7)
    • ►  June 2019 (1)
    • ►  May 2019 (2)
    • ►  March 2019 (4)
  • ►  2018 (111)
    • ►  November 2018 (7)
    • ►  October 2018 (20)
    • ►  September 2018 (10)
    • ►  August 2018 (3)
    • ►  July 2018 (19)
    • ►  June 2018 (5)
    • ►  May 2018 (2)
    • ►  April 2018 (3)
    • ►  March 2018 (11)
    • ►  February 2018 (18)
    • ►  January 2018 (13)
  • ▼  2017 (36)
    • ▼  December 2017 (10)
      • Java Swing (GUI) Use of JTable from JTextFields - ...
      • Java Tutorial - 29 Methods in Java - StudyViral
      • Java Tutorial - 28 Constructor in Java - StudyViral
      • Java Swing Tutorial - Create Animated Splash Scree...
      • Java Swing Tutorials (GUI) - Read and Write JList ...
      • Java Swing (GUI) - Update JList Data - Study Vira
      • Java GUI - JList (Java Swing) Using Netbeans Part ...
      • Java GUI - JList (Java Swing) Using Netbeans Part ...
      • Java GUI - Count Down Timer (Java Swing) Using Net...
      • Java Tutorial - 27 Class & Objects in Java - Study...
    • ►  November 2017 (9)
    • ►  October 2017 (7)
    • ►  September 2017 (10)

About Me

Rohit Basra
Hello guys my name Rohit Basra. I love to code and teach java language.
View my complete profile

Followers

Copyright © Study Viral (Java Tutorials For Beginners - Step By Step) | Powered by Blogger