yup!!! this is my first application in JAVA. its a calculator, yeh yeh it has bugs and 'm trying to take them off. but still eager to post this in my blog ;).
Anyways bug is the part of software cycle u see so its a bugfull calculator n soon a bugfree will be launched when i will learn jar creation. Kepp smiling and yes the mantra Happiness Always. dont forget it. cheers.
Please find the code below;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class CalC implements ActionListener {
private JFrame f;
private JButton b1, b2, b3, b4, b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18;
private JLabel l1;
public int sum = 0,res=0,n1=0,n2=0,sum1=1,d,n3=1;
public char a;
public CalC() {
f = new JFrame("Tabu's calculator");
b1 = new JButton("1");
b1.addActionListener(this);
b2 = new JButton("2");
b2.addActionListener(this);
b3 = new JButton("3");
b3.addActionListener(this);
b4 = new JButton("4");
b4.addActionListener(this);
b5 = new JButton("5");
b5.addActionListener(this);
b6 = new JButton("6");
b6.addActionListener(this);
b7 = new JButton("7");
b7.addActionListener(this);
b8 = new JButton("8");
b8.addActionListener(this);
b9 = new JButton("9");
b9.addActionListener(this);
b16 = new JButton("0");
b16.addActionListener(this);
b17 = new JButton("Reset");
b17.addActionListener(this);
b10 = new JButton("+");
b10.addActionListener(this);
b11 = new JButton("-");
b11.addActionListener(this);
b12 = new JButton("*");
b12.addActionListener(this);
b13 = new JButton("/");
b13.addActionListener(this);
b14 = new JButton("%");
b14.addActionListener(this);
b15 = new JButton("=");
b15.addActionListener(this);
b18 = new JButton("Exit");
b18.addActionListener(this);
l1 = new JLabel(" ");
}
public void launchFrame() {
f.setLayout (new GridLayout(7,3));
f.add(b1);
f.add(b2);
f.add(b3);
f.add(b4);
f.add(b5);
f.add(b6);
f.add(b7);
f.add(b8);
f.add(b9);
f.add(b16);
f.add(b10);
f.add(b11);
f.add(b12);
f.add(b13);
f.add(b14);
f.add(b15);
f.add(b17);
f.add(b18);
f.add(l1);
f.pack();
f.setSize(300,300);
f.setLocation(200,200);
f.setVisible(true);
}
public void actionPerformed (ActionEvent ev)
{
try
{
if(ev.getSource()==b1)
{
n1=n1*10+1;
l1.setText(" " +n1);
}
if(ev.getSource()==b2)
{
n1=n1*10+2;
l1.setText(" " +n1);
}
if(ev.getSource()==b3)
{
n1=n1*10+3;
l1.setText(" " +n1);
}
if(ev.getSource()==b4)
{
n1=n1*10+4;
l1.setText(" " +n1);
}
if(ev.getSource()==b5)
{
n1=n1*10+5;
l1.setText(" " +n1);
}
if(ev.getSource()==b6){
n1=n1*10+6;
l1.setText(" " +n1);
}
if(ev.getSource()==b7)
{
n1=n1*10+7;
l1.setText(" " +n1);
}
if(ev.getSource()==b8)
{
n1=n1*10+8;
l1.setText(" " +n1);
}
if(ev.getSource()==b9)
{
n1=n1*10+9;
l1.setText(" " +n1);
}
if(ev.getSource()==b16)
{
n1=n1*10+0;
l1.setText(" " +n1);
}
if(ev.getSource()==b10)
{
n2=n1;
n1=0;
sum= sum+n2;
l1.setText(" " +sum);
a='+';
}
if(ev.getSource()==b11)
{
if (n3==1)
{
n2=n1;
sum = n2;
l1.setText(" " +n2);
n3=0;
n1=0;
a='-';
}
else
{
n2=n1;
n1=0;
sum=sum-n2;
l1.setText(" " +sum);
n3=0;
a='-';
}
}
if(ev.getSource()==b12)
{
n2=n1;
n1=0;
sum1=sum1*n2;
l1.setText(" " +sum1);
a='*';
}
if(ev.getSource()==b13)
{
n2=n1;
n1=0;
l1.setText("singlw div only");
a='/';
}
if(ev.getSource()==b14)
{
n2=n1;
n1=0;
l1.setText(" " +n2);
a='%';
}
if(ev.getSource()==b17)
{
n1=0;
n2=0;
sum=0;
res=0;
l1.setText("00");
sum1=0;
n3=1;
}
if(ev.getSource()==b18)
{
f.setVisible(false);
}
if(ev.getSource()==b15)
{
switch (a)
{
case '+':
res =sum+ n1;
l1.setText(" " +res);
sum=res;
break;
case '-':
res = sum-n1;
l1.setText(" " +res);
sum=res;
break;
case '*':
res = n1*sum1;
l1.setText(" " +res);
sum1=res;
break;
case '/':
if(n2==0)
1.setText("/by0");
else
{
res = n2/n1;
l1.setText(" " +res);
}
break;
case '%':
res = n2%n1;
l1.setText(" " +res);
n1=0;
n2=0;
sum=0;
break;
}
a=' ';
}
}
catch(Exception e)
{
System.out.println("Error: " +e.getMessage());
}
}
public static void main(String args[]) {
CalC grid = new CalC();
grid.launchFrame();
}
}
About Me
- Tabassum Rehman Muneer
- 'm frank, smart enough to deal with any kind of people, 've got ebility to communicate with al kind of peolpe, every1 who meets me start liking me.:) i love to smile... interestingly my name means smile:)
Sunday, May 23, 2010
Sunday, May 9, 2010
I think its law if attarction

This always happen with me. I now experiencing the bangalore traffic in real through BMTC busses. My class is just in front of a signal. If the bus wont stop in signal i have to again walk around like 1KM to come back to my class. So wen ever my bus reaches near my class i keep thinking signal red hoja red hoja red hoja. When i am late its sure ki the bus missed the signal n crosses the road n i have to get down in next stop n walk back again to class. When i an 30 mins early to class n i dont think abt the signal"my dear bus" stops at signal for hell lot of time. Grrrrrrrrrrrr
It happens not once but always. I am new to BMTC though old to bangalore. I make it sure i stamp on few or i myself fall a number times on bus. I am still getting used to bus crowd n getting used to the people n bus stops. But one thing is sure, travelling in bus i got to discover many routes in bangalore. Pehle jab meri scooty thi i had known only one way.
I wonder ki jab bhi i am late for class my bus happen to meet with many red signals n i happen to miss few busses or take a wrong us n bla bla. and wen u have lot of time n leave early n i think i can go araamse. My bus always faces green signal in trafic n i get bus many frequently n also no any other drama. every day i leave at 8. thought the class at 9:30 i leave at 8 then there wont be much traffic problems n reach class at 8:50. and wen class is at 9 i leave at 8 n i reach class at 9 :15. coz of traffic signal n bla bla. My badluck? no its law of attraction. Wen i am early to class i dont care abt signals n wen i am late i keep looking at signal n expect it not to be red. The law of attraction acts reverse n the signal turns red. I dont know y i am writting this blog, may be coz i am frustrated with the traffic in bangalore. God plz mujhe isse mukti dilado.
Yes, I dont like pumpkin.
No no no its not about me..... Its about a girl in my PG(Paying Guest house) who happen to stay with us for a while. Lets call her Taany. In our PG there are few ppl who r guess visitors i mean who come to stay for a while like for 2-3 months. Taany happen to be one of them. Cute, cute n cute is the only word i got in my mind wen i saw her. I was shocked for a sec. when i heard she just passed her 12th n here for some CLaw coaching. Had a nice time with her.
So here's a pumpkin story. Mere PG ka khaana (good but still its mess food yaar). logon ke dil me bas jaata hai ki mess food not good though it taste's same as home food but still hum comment karte hain. Once we had some sabzi in dinner. I tasted it, it tasted weird so i served myself some ketchup n roti. Then i saw other they wer enjoying food, so the conversation between me n taany went like this:
Me:Tum ye sabzi kha rahi ho?
Taany: Haan kyun? achi hai,Aloo ki sabzi toh hai :P
Me: acha u have pumpkin also?
Taany: no me pumpkin kabhi nahi khaati.
Me: toh ye kya hai, the sabzi has pumpkin smashed in it. The oranfe thing is pumpkin n yellow is aloo.
Taany: arey nahi,. Then she had a close look at the sabzi. She kept the plate n went out. when i asked she said i dont like pumpkin, i have never had it. But the funny part it. B4 i tel her there's pumpkin in the sabzi she was enjoying it, n now wen i said her its pumpkin, its not tasting good.
I never knew that sabzi ka naam also matters. so i say naam pe mat jaao apni zabaan lagao(i mean taste pe jaao). he he he
Sunday, February 7, 2010

I never imagined I could ever prepare Dhoklas at home..As we've always had it from snack shops. They would have a huge tray on the counter, cut into with big square shaped pieces. Often served with green chutney and fried green chillies, it tastes delicious. I still believe, street food is the best food!!! Ofcourse discount the hygiene factor..:-)
Ingredients:
2 cups gram flour,
1 cup sour curds,
2 tsp ginger-green chilli paste,
1 tbsp oil,
1 tsp fruit salt or sweet soda(cooking soda) (ENO),
1 tsp lemon juice,
1/2 cup warm water,
Salt as per taste
For tempering:
2 tbsp oil,
1 tsp mustard seeds,
1 tsp sesame seeds,
grated coconut
Method:
1.)Combine the gram flour, sour curd, and 1/2 cup of warm water in a bowl and mix till smooth. Set aside for 45 mins.
2.) Add the ginger-green chilli past, oil and salt and mix well.
3.) Grease a 7 inch diameter thali and set aside.
4.) Just before steaming add the fruit salt and lemon juice. Fold the batter once bubbles form, very gently.
5.) Pour the batter immediately into the greased thali and spread the batter evenly.
6.) Steam for 15 to 20 mins or till a skewer inserted comes out clean.
7.) For the tempering, heat the remaining oil. Add the mustard seeds and sesame seeds. Once the seeds crackle add asafoetida and 2 tbsp of water. Pour the tempering over the prepared dhoklas.
8.) Cool slightly and cut into equal pieces. Garnish with coriander and green chilli and serve hot.
Tips:
Add the fruit salt to the batter just before you are ready to steam the dhoklas, or they will not rise.
The water in the steamer/cooker should be boiling before you put in the uncooked batter, so that the dhoklas will cook faster and rise well.
The more u garnish the more delecious it turns good. U can have it with a combination of green and sweet chutney.

Ingredients
Powdered sugar : 1 cup
Butter : ½ cup
Milk powder : 1 cup
Cocoa powder : ½ cup
Water : ¼ cup
Method
Set microwave to high power.
In a bowl, mix sugar and water and keep it in the oven for 4 - 5 minutes.
Check to see if it has attained a two string consistency.
That is, if we take the syrup between the tip of our fingers and stretch our fingers two strings of syrup should appear.
Add butter and keep the bowl in the oven for1 minute.
Remove from the oven, add milk powder, cocoa powder and mix well.
Pour this on greased plate or chocolate moulds to set.
If needed we can garnish it with cashew, badam, pista etc.
P.S.: Add roasted almonds and raisens and more nuts to the mixture. If u follow the procedure corredtly u'll end up making delicious chocolate as good as Gadbury Temptations.
ALL The best
Thursday, January 7, 2010
beetroot curry

Beet root curry.
Ingredients : Beet root 2 numbers
Zeera: 1 T spoon
Coconut: 2cm-2cm cube
Red dry chilly: 8-10 numbers
Kari patta(kari bevu): 10-15 leaves
Green Coriander : 5 twigs
1 onion finelt chopped
Tamarind: 4 numbers
Oil for tadka
Procedure:
Shallow fry all ingredients except beetroot on medium flame and grind to paste.
Cut beetroot into small cubes and boil in 1 leter of water. Collect the drained water and keep aside.
Now take little oil and add mustard seeds and kari patta, onion for tadka and add the paste of the ingredients made. Now add beetroot drained oink colour water collected. Add salt and tamarind paste according to the taste. Leave it to boil for some time. Beet root curry is ready and u can also sip it as a soup.
This is usually made for Dal Curry. We usaully replace beetroot with Dal, rest all procedure. use dal stock inplace of beetroot stock. I tried it with beetroot stock as it is more colourful, temptating to eat. U can use the left over beetroot to make side dish. Use the usual tadka of curry leaves, mustard seeds, onion and add left over beetroot. Add salt to taste. Garnish with some grated coconut. Yummie dish. Taste good with white rice.
My birthday come back and surprize
As I say my birthday’s are always special. So far enjoyed with my bunch of frenz for almost 12 years suddenly last year everything changed. A fren got married I relocated to b’lore and was worried don’t know there’s no excitement and wat’ll I do on my b’day no plans nothing. Thanks to my Dr. frenz in PG who made my day with a surprise party. But this year again a different situation. All my Dr. frenz are settled in all different places and I ‘ve landed here at home. As December approached I was worried and upset as to what to do. How will I celebrate my day. I almost thought ok I’m grown up so may be I shud stop being childish and be serious. No party nothing just pray and wish myself. And here I get a secret talk by some1 that my little cousins (who are in school 1st std to 7th std) are not willing to go for their Christmas vacation trip. They want to stay back and give me a surprise. They actually were practicing for some dance and singing just for me. I was completely glad and happy happy. Then I asked one of those bribing with some tofies that are u guys doing this I heard somewhere. That idiot said no we aren’t. trust me. What do u think? Mom ‘ll leave us do that a? Then I thought may be that was a rumour but still has a hope. Then here started my shopping for my birthday with the start of December. I this time have end up buying 4 pair of dresses for my birthday. Yet not satisfied coz I felt may be I didn’t get the one I needed. Then thought anyways its not gonna be a special day and ‘ll be as a normal day so did no much purchase. Yeah but on my b’day I wear everything new and use all new. (includes tooth brush to paste to moisturizer, shoes, everything). Don’t have a budget to ‘ve new jewelery Insha Allah I’ll one day.
24th December I made it sure that I reminded all possible people abt my b’day. My granny, my pappa, my mom and brothers every1 and many of my frenz. Ok it’s the night I was all set to wish myself first for my b’day. There a knock at my door. Who’s it? Some khalbali inside me….. opened the door OMG I see my 2 brothers and bhabhi with a cake and candle on it. I was sooo happy I cudn’t say a word. But wrong timing it was still 10 mins for 12. Then I called my younger bro who was fast asleep (he was in pune so). Started screaming don’t u ‘ve shame its my b’day.get up and wish me all are here and wait still 5 mins there. Then ok here the clock ticks and the b’day song started happy b’day to u (ahhhh I love this song). My y’bro asked hogaya? Me so jaon? Ok bye kal mamma ke paar tumhare gift pada hai le le na ok. Baad me b’day cake ka imp kaam hua. Sab mujpe paint ho gaya. Well later my elder bro heard a beep from my cell. I tried to hide but I cudn’t see. It was actually my b’day reminder on my own cell lolz. All started laughing like hell. Then I explained in case I forget to wish myself. Ok that was the begening. Later mom and dad Wished me and shouted on bro ki humko kyun nahi bola abt the cake and all. We wud have joind (mom aur dad jawaan ho rahe hain ROFL).followed by many phone call wishes by frenz. Lated at 3 I started jotting down who all wished me. Did any1 important forgot. I remembered 2 ppl. Called up and started shouting how cud u do this. How can u sleep nicely on this very big day of mine. How dare u n all.. After some pause I got a voice from other end, “Y wat happen? Whats today?” it got on my nerves and I again started its 25th Dec for ur kind info. “Of ‘m sooo very sorry, I didnt forget ur b’day, I just didn’t notice the date. “m so sorry I owe u for this. And blab la bla.” Here me saying gain are u gonna wish me or not now? Oh ‘m sooo sorry. ?Happy b’day baby. Now 2nd call but not reachable . Forget it ‘ll see to it tomorrow. Its ur day darling enjoy. With some good melodious music I slept again.
At exact 4:30 again a knock at my door. OMG I don’t believe this, my sooo little cousins standing right in front of my door and singing me b’day song just like ppl sing carol in front of ur door. I called them in and started serving them the left over cake. What do I see. One of them went out and bought the cake which they were hiding near the door. They said 4:30 hogaye kya? Ok chalo cake kaato. AAp 4:30 ko he aayi thi na is world me. SO nice of them. I almost started crying, hugging and crying. It was a home made cake. Glad that aunt also helped for that. Felt like the princess. Ok chalo its very cold u all go back ‘ll meet in the morning. I came back with lots of joy in my heart. Slept and ya cud not coz I had calls and calls. Special special. I woke up early had to get blessings from dad and mom. It was ten and I was out of bed. New day new year everything new. Got ready and took blessings and all. It was Friday so Prayer and prayer service all over and so eat up my half day with this stuff. A visit to church was must and met frenz. When I came back home surprise, my wudbe bhabi had sent a gift and a bigggggggg cake again. And my cuttie cousins reay with their arrangements. Poor cutties so eagerly waiting for me coz they had to leave for their vacation trip, they managed to stay till 25th bugging their parents. All my fav. Songs and dance. I was the guest of honour. Wow it feels so good. After that the same old b’day party went on. Oh ‘m tired. Now time to unpack the gifts Which a got from 2 days thanks to fast courier service. Finished all tasks and tired completely, off to bed jotting down names of all who missed to wish me. Koi baat nahi dekhlenge kameeno ko. Slept with lots of joy and happiness.
See I told u I didn’t expect and still I birthday turned out to be special. No wonder ‘m excited abt my birthdays.
P.S.: Thanks to all who made it special. Sorry to many whose call I cudn’t attended. But ur wishes are counted, U remember to wish that really worth it.
Thought for this year:
What if you were an alien that just beamed onto Earth and you didn’t know the rules? What if you didn’t know the way things were done and you were free to create a solution to any problem or expand any opportunity? Chances are, you’d tap into your reservoir of creativity and create brand new solutions and possibilities.
Subscribe to:
Posts (Atom)