Skip to main content

Posts

Agile Methodology with SCRUM Framework Basics

Software development activities can be managed and taken care with different life cycle models. These life cycle models has became legacy since few years. Few of the available Software Development Life Cycle Models in short SDLC are Win-Win Model and Waterfall Model etc. These traditional models has different phases of development.           1. Requirements            2. Analysis            3. Design            4. Implementation            5. Test           6. Documentation  and 7. Maintenance  In SDLC, the above stages are freezed one after the other. If developer is in Design phase and realized that there could be a possibility of change in requirements, then it is not possible to go back one phase and fix in Requirement phase.  These scenarios and use cases has brough...

Java API support for Exception Handling

First of all, please read below blog post to understand basics of Exception Handling in java. Exception handling and java keywords To continue from there, Basically Java default API has hierarchy of  java classes to support different uses cases of exceptions.  The parent class of all Exceptions and Errors is Throwable . Please check below pictorial representation of  API Hierarchy. Exception: The class Exception and any subclasses that are also not subclasses of RuntimeException are checked exceptions. And all subclasses of RuntimeException and RuntimeException class itself are Unchecked exception . Rest all are Checked exceptions Examples of Unchecked Exceptions:            ArrayIndexOutOfBoundException          NullPointerException Error: An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions. Examples: T...

Java - Swing custom components - Rounded JButton

Unlike AWT, Java Swing tool kit provides feasibilty to create custom components and containers. To understand Java GUI toolkits more clearly, please read my other articles on Swing and AWT.  In this article I focus more on building custom components. Let us see how to create simple Rounded JButton. The below program demonstrates How rounded JButton can be created and added to a JFrame.   Program: import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.GridLayout; import java.awt.Shape; import java.awt.geom.Ellipse2D; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class RoundedJButton extends JButton { /** *  */ private static final long serialVersionUID = 1L; public RoundedJButton(String title) { super(title); Dimension size = getPreferredSize(); size.w...

Exception handling and java keywords

Exception: Exception in a programming language and in English language is pretty similar. Exception means being different from or not following the rules. And in programming language like Java, exception is  an event which occurs during the execution of a program that disturbs the complete flow of application or program. When something beyond expected happens while executing a program is considered as an error. handling these errors or abnormality is called as Exception handling. Exception Handling: Exception handling in java is managed with the help of java keywords and java API support..              1. Java Keywords             2. Java API support Java Keywords:   There are 5 keywords in Java.           1. Try           2. catch           3. finally           4. throw    and 5. throws These five keywor...

Java and OOPS concepts

Java is an object oriented programming language which can be downloaded and installed in your local Machine from java.com To explain java binaries and tools requires block diagram which gives clear picture. For now I brief few important tools. JDK - java development toolkit JVM - Java virtual machine JRE - Java Run time environment From oracle site we can download JDK which is shipped along with JVM and JRM. Mostly java programmers need the JDK. For end users JRE alone is enough. Basic OOPS characteristics are Inheritance Encapsulation Abstraction and Polymorphism The above concepts collectively makes application software extendable and changeable with less effort. Also helps in Developing design patterns. Design patterns gives solutions for common challenges usually a programmer faces while development applications. Factory design pattern, Abstract design pattern, Builder pattern etc. I explain these Design patterns in another article. Inheritance : Inherita...

Core Java: Immutable objects and mutable objects with an example

Immutable objects and mutable objects with an example  In object oriented programming language, in short OOPS, every problem, precisely every requirement is viewed as an object. Understanding the problem in this point of view brings many good things possible in programming like encapsulation, abstraction, polymorphism and inheritance. Anyways this post is not intended for describing benefits of OOPS. Object could be any thing. Let us take Car  for an instance. Basically car is an object and it has name, wheels, metal body, engine, maximum speed,  gear box etc as properties. Let us consider the car name is Ferrari, maximum speed is 200 km per hr with 6 gears. While driving the car driver can change the speed of the car and change the gear etc. So while car is running it's current speed, current gear are considered to be state of the object. The current speed can be changed using accelerator and gear can be changed using gear box. These can be considered as ...

Swing JLabel demo with example

This article is continuation of previous post JFrame usage demo . Please read it before continuing. This post uses the same example code shown in  JFrame usage demo  with JLabel changes and introduces layout manager BorderLayout. Layout Manager: Layout manager is responsible to arrange components on containers. Usually every swing container is created with a default layout manager but can be changed with setLayout() api. For example JFrame uses BorderLayout as default layout amanger. Java program for JLabel 1  2   import java.awt.BorderLayout; 3   import java.awt.Color; 4   import java.awt.Font; 5  6   import javax.swing.JFrame; 7   import javax.swing.JLabel; 8   import javax.swing.SwingUtilities; 9  10  /** 11   * 12   * Simple class to demonstrate JLabel of swing toolkit 13   * 14   * @author Nagasharath 15   * 16  ...