Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Tuesday, October 19, 2010

Bank Process in java using Queues

Hello again :d

This is also one of my assignment in MIT at MUST and still managed to finished this one. even though im not good in java :D . I forced to study Graphics to finished my assignment, but i really enjoyed while doing this program.


This is a Banking Process in java using queues.


















Source file soon.. :D

Bubble with Graphics using java

Hello everyone i am back and start posting some ideas and info about programming, anyways here's my Bubble sort using java, actually this is my assignment in MIT at MUST.

In fact i'm not good in java programming specifically in Graphics :), but i still managed to finished my assignment in a short time. :). I'm forced to do study and finished this one.

I would like to share this to you maybe you can find some important code which help you later on.



















I'll just upload the file soon.. :D

Wednesday, March 4, 2009

Simple room reservation program in java using array, loop and if statement.

Simple program i created in java room reservation and cancellation.

Combination of Array, for loop and if statement. You can get more knowledge in this program. Basic program using java that gives alot of lesson to a begginer like you :-).
























You can donwload my sample program below.



Download File

Tuesday, March 3, 2009

how to create Listbox in JAVA?

Simple program that let the user add data inside the List box using JAVA together with List, JTextField and JButton under Swing Components..









































You can download my example below.


Download File

Monday, March 2, 2009

Changing the background color of the JPanel using JAVA

Allows user change the color of the panel or JPanel in this program using JFrame and 3 buttons.














































You can download my example below.


Download File

Sample java program using JFrame, JButton and JRadioButton.

This simple program using JFrame in java allows user to multiply, Add, Subtract and Divide numbers just enter your number in the first and second text and select your operation and just simply click the button 'Show Answer' and clearing the value inside the Textbox just simply click 'Clear' button.














import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

class JSample extends JFrame implements ActionListener {
JButton b1;
JButton b2;
JRadioButton r1;
JRadioButton r2;
JRadioButton r3;
JRadioButton r4;
JCheckBox c1;
JTextField txt1;
JTextField txt2;
public JSample() {
Container p = getContentPane();
JPanel jp = new JPanel();
ButtonGroup bg = new ButtonGroup();
p.add(jp);

bg.add(r1=new JRadioButton("Mutiplication"));
bg.add(r2=new JRadioButton("Addtion"));
bg.add(r3=new JRadioButton("Subtraction"));
bg.add(r4=new JRadioButton("Division"));
jp.add(r1);
jp.add(r2);
jp.add(r3);
jp.add(r4);
jp.add(txt1=new JTextField(5));
jp.add(txt2=new JTextField(5));
jp.add(b1=new JButton("Show Answer"));
jp.add(b2=new JButton("Clear"));
b1.addActionListener(this);
b2.addActionListener(this);
}
public static void main(String[] args) {
JSample js = new JSample();
js.setVisible(true);
js.setSize(400,100);
js.setTitle("Basic Aritmetic Operations - *, +, -, /");
js.setResizable(false);
}
public void actionPerformed(ActionEvent e) {
double ans=0.0;
JOptionPane j = new JOptionPane();
if(e.getSource() == b1) {
if(r1.isSelected()) {
ans=Double.parseDouble(txt2.getText()) * Double.parseDouble(txt1.getText());
j.showMessageDialog(null,"Answer: "+ ans);
}else if(r2.isSelected()) {
ans=Double.parseDouble(txt2.getText()) + Double.parseDouble(txt1.getText());
j.showMessageDialog(null,"Answer: "+ ans);
}else if(r3.isSelected()) {
ans=Double.parseDouble(txt2.getText()) - Double.parseDouble(txt1.getText());
j.showMessageDialog(null,"Answer: "+ ans);
}else if(r4.isSelected()) {
ans=Double.parseDouble(txt2.getText()) / Double.parseDouble(txt1.getText());
j.showMessageDialog(null,"Answer: "+ ans);
}else {
j.showMessageDialog(null,"Select first Operation","Error",JOptionPane.ERROR_MESSAGE);
txt1.setText("");
txt2.setText("");
}
}else if(e.getSource() == b2) {
txt1.setText("");
txt2.setText("");
}
}
}



You can download my example below.


Download File


Wednesday, February 11, 2009

Simple data manipulation using java and ARRAYS.

BASIC STUDENT INFORMATION

This program allows user add, edit, delete, display and search using JAVA PROGRAM.
It is a simple data manipulation of data using arrays with out having any dynamic database like access of sql server it just simple array and algorithm. I use IO package for this program in order user can input data.. looping for searching and display those data inside my ARRAYS. You can download this program and you can post comments and suggestions below. Thank you...












You can download my example below.


Download File

Monday, January 26, 2009

How to use toLowerCase in java?

toLowerCase() is one the basic method of the string class.
I have here and example using toLowerCase() method converting the Upper case text into
lower case.

Example my name:

String name ="JOHN EMISYL PALER"; Declaration of variable.
To convert my name into lower case form heres the following syntax.

System.out.println(name.toLowerCase());









You can download my example below.

Download File

How to use toUpperCase in java?

toUpperCase() is one also of the basic method of string class in java like toLowerCase() method.
toUpperCase() method is opposite of toLowerCase() method. toLowerCase() is converting Upper case text into Lower case. They have different action dealing with Strings or Text. I have here an Example for toUpperCase() method.

Example:

String name="john emisyl paler";

System.out.println(name.toUpperCase());













You can download my example below.

Download File

Sunday, January 25, 2009

How to create Factorial using java?

I have here an example getting the factorial of the given value in this example i used
import.java.io.*; its a kind of package in java in order the user will input a number.
IO means
Input and Output
. For example if the user will input 5 basically the factorial of 5 is 120 i have here a formula getting 120.

5 is the user input

solution
1 x 2 x 3 x 4 x 5 = 120

In order we can get the 120 in java we will use for loop statement on of the loop statement in java. Here the Output!

****
****OUTPUT**********












You can download my example below.

Download File


//I have here very nice example for do while.

class dowhile
{ //class name
public static void main(String[] args) { //default method of java
int x = 1;
do {
System.out.println("Number: " + x);
x++;
}while(x<=10);


/*
Instructions

int x=1 is your declaration of your variable.
x<=10 is your condition til the condition becomes false.
x++ is your Incrementation in-order your x will move starts 1 to 10.
System.out.println("Number: " + x); is for display Number : 1 to 10.

*/

}
}


********OUTPUT**********













Download File

How to use for loop in java programming?

//I have here very nice example for forloop.

class forloop
{ //Your class the name of the is 'forloop
public static void main(String[] args) {
for(int x=1; x<=10;x++) { //
System.out.println("Number: " + x);
}

/*
Instructions

int x=1 is your declaration of your variable starts from 1 to 10.
x<=10 is your condition til the condition becomes false.
x++ is your Incrementation in-order your x will move starts 1 to 10.
System.out.println("Number: " + x); is for display Number : 1 to 10

*/

}
}

/*
********OUTPUT**********

Number: 1
Number: 2
Number: 3
Number: 4
Number: 5
Number: 6
Number: 7
Number: 8
Number: 9
Number: 10


*/

Download File
 

blogger templates | Make Money Online