Posts Tagged programmer

Trick of Positioning the Containers of JFrame

Many developers want their own Layout Manager with user-defined so JAVA has provided a separate method for the every container of JFrame Component and that method is setBounds(). This method helps the developers to position the container as per their need .

About SetBounds() method:

This method consists four parameter

     xxx.setBounds(int x_axis, int y_axis, int width, int height);

We can arrange the containers with the help of this method easily. Read the rest of this entry »

Tags: , , , , , , , , , ,

A simple Lucky draw Program

Here I’m going to show a simple program which picks random 6 character and assigns the point for that code no.

If it consists vowel letter then

a =1, e=2, i=3, o=4,e=5

and if no any vowel letter then it is awarded by 100 pts.

If you to download code then (CLICK HERE)

The program is given below:
//import directives for Input of Keyboard
import java.util.Scanner;

public class LuckyDraw
static String name;
static int point = 0;
char[] code;
String setOfAlphabet;

public LuckyDraw(){
code = new char[6];
setOfAlphabet = “abcdefghijklmnopqrstuvwxyz”;

//looping the random character
public void loop(){

//handling two side :
//one at loop
//other at assgning the char in char array;
int i=0;

//flag of the while loop
boolean flag = true;


int b = (int)(Math.random()* setOfAlphabet.length());
code[i] = setOfAlphabet.charAt(b);

//condition for stopping loop
if(i == 6) flag = false;


//assigns the points
public void points(){

System.out.print(“Your code No\t\t\t:”);

for(char a : code){
//assing the score
if(a == ‘a’)point += 1;
if(a == ‘e’)point += 2;
if(a == ‘i’)point += 3;
if(a == ‘o’)point += 4;
if(a == ‘u’)point += 5;
//exception if there are no any vowel letter
// then give 100 point
if(point == 0) point = 100;


System.out.printf(“Your have scored\t\t:%s pts\n”,point);


//main method
public static void main (String[] args)
//giving input of name
Scanner scan = new Scanner(;
System.out.print(“Please enter your name\t:”);
name =;

//invoking the methods to display
LuckyDraw lucky = new LuckyDraw();



Tags: , , , , , , ,

UML Notation

In this blog now u will learn the process of UML. The first thing that we need to understand to develop the UML and for developing it we should have a good knowledge of the classes and the data dictionary of the project which u r going to develop. Now I am gonna prepare a data dictionary of the PTS(Prescription Tracking System)

The detail data dictionary of the Prescription Tracking System is given below:

Data Dictionary of the PTS (Prescription Tracking System)


Customer: The customer is the person who buys the medicine .

Read the rest of this entry »

Tags: , , , , , , , , ,