Ads

Tuesday, 23 October 2012

AWT CONTROL


PROGRAMS

CHECK BOX:
import java.awt.*;
import java.awt.event.*;
class checkbox extends Frame implements ActionListener,ItemListener
{
Checkbox x,y,z;
CheckboxGroup a;
Button b1;
public checkbox()
{
b1=new Button("EXIT");
setLayout(new FlowLayout());
a=new CheckboxGroup();
x=new Checkbox("CSE");
y=new Checkbox("IT");
z=new Checkbox("ECE");
add(x);
add(y);
add(z);
add(b1);
x.addItemListener(this);
y.addItemListener(this);
z.addItemListener(this);
setLocation(100,100);
show();
b1.addActionListener(this);}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("EXIT"))
{
System.exit(1);
}}
public void itemStateChanged(ItemEvent e)
{
System.out.println("CSE"+x.getState());
System.out.println("IT"+y.getState());
System.out.println("ECE"+z.getState());
}
public static void main(String ar[])
{
checkbox c=new checkbox();
} }


CHOICE:

import java.awt.*;
import java.awt.event.*;
class choice extends Frame implements ActionListener,ItemListener{
Button b1;
Choice c;
public choice(){
b1=new Button("EXIT");
c=new Choice();
c.add("Green");
c.add("Red");
c.add("Blue");
c.add("Gray");
add(c);
add(b1);
b1.addActionListener(this);
c.addItemListener(this);}
public void actionPerformed(ActionEvent e){
if(e.getActionCommand().equals("EXIT")){
System.exit(1);
}}
public void itemStateChanged(ItemEvent b1)
{
if(c.getSelectedItem().equals("Green"))
{
setBackground(Color.green);
}
else if(c.getSelectedItem().equals("Red"))
{
setBackground(Color.red);
}
else if(c.getSelectedItem().equals("Blue")){
setBackground(Color.blue);}
else if(c.getSelectedItem().equals("Gray")){
setBackground(Color.gray);
}}
public static void main(String args[]){
choice t=new choice();
t.setLayout(new FlowLayout());
t.setSize(200,200);
t.setLocation(100,100);
t.show();
}}

LIST:

import java.awt.*;
import java.awt.event.*;
class list extends Frame implements ActionListener
{
Button b1;
public list()
{
b1=new Button("EXIT");
add(b1);
List lst=new List(4,false);
lst.add("CSE");
lst.add("IT");
lst.add("ECE");
lst.add("EEE");
lst.add("CHEM");
add(lst);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("EXIT"))
{
System.exit(1);
}
}
public static void main(String args[])
{
list l=new list();
l.setLayout(new FlowLayout());
l.setSize(400,200);
l.setLocation(100,100);
l.show();
}
}

SCROLL:

import java.awt.*;
import java.awt.event.*;
class Demo extends Frame implements ActionListener
{
Scrollbar sc=new Scrollbar();
Button b1;
public Demo()
{
b1=new Button("EXIT");
add(b1);
FlowLayout f1=new FlowLayout();
setLayout(f1);
add(sc);
b1.addActionListener(this);
setSize(500,500);
show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("EXIT"))
{
System.exit(1);
}
}
}

class Scroll
{
public static void main(String args[])
{
Demo s=new Demo();
}
}

TEXT:

import java.awt.*;
import java.awt.event.*;
class text extends Frame implements ActionListener
{
FlowLayout f=new FlowLayout();
TextField t1=new TextField(10);
TextField t2=new TextField(10);
Button b=new Button("COPY");
Button b1=new Button("EXIT");
public text()
{
setLayout(f);
setSize(600,400);
setLocation(200,200);
add(t1);
add(t2);
b.addActionListener(this);
add(b);
b1.addActionListener(this);
add(b1);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("COPY"))
{
t2.setText(t1.getText());
}
else if(e.getActionCommand().equals("EXIT"))
{
System.exit(1);
}
}
public static void main(String args[])
{
text t1=new text();
}
}






Wednesday, 8 August 2012

Silver medallist Vijay Kumar returns to rousing Army welcome




NEW DELHI: Two days after he had threatened to quit his job for being denied a promotion, London Olympics silver medallist Subedar Vijay Kumar was on Wednesday accorded a rousing welcome by the Indian Army on his arrival at the Indira Gandhi International Airport here.

"It is a really fantastic reception and I am really touched by it. This is the first time I am getting such a welcome," Kumar said after his arrival at the IGI from where he was driven to the Army headquarters on an open Gypsy.

A part of terminal 3 here went green as the Army personnel turned up in full force to receive the shooter who has done the country proud by clinching a silver in 25-m rapid fire pistol event, the lone white metal winner so far.

The place resonated not just with the sounds of drums and the traditional nagaras, the national anthem was also played at the background once the man of the moment's Lufthansa 762 flight touched down early in the morning.

Soon after the shooter won his medal, Kumar had made it clear in London that he was unhappy that he had not got a single promotion in the last six years, despite some major sporting achievements at the national and international level.

Sports Minister Ajay Maken has taken up the shooter's cause and has written to Defence Minister AK Antony, seeking special consideration for the athlete who has done India proud.

"I had done the country proud by winning at major events in 2006, Delhi 2010 (CWG) and London 2012 and was expecting promotion and decorations. As sportspersons we also have expectations," the 2010 Commonwealth Games multiple gold winner said on his return home.

He further said: "Offers have started to pour in from all quarters and the sports minister has openly said that I can be given a job in SAI at the IAS officer's level. I am expecting a similar offer from Army."

Though he started serious shooting only after joining the Army, Kumar said he realised that this was something which he always had it in him.

Kumar may have just won a medal but he is already thinking about the 2016 Olympics at Rio de Janeiro, Brazil.

"I will take a brief break now and then again focus on the 2016 Olympics."

Beside the Army personnel from his 16 Dogra Regiment and Kumar's parents that comprised his father, mother and grandmother, also present with garlands were about 35-40 officials from the National Rifle Association of India (NRAI).

Chants of 'Vijay Kumar zindabad' and 'Indian Army zindabad' were heard all across. And basking in Kumar's glory was his father Banku Ram, a retired Subedar in the Army.

"A lot of hard work has gone into it. He has won a medal because he has spent a lot of time training away from home. He wouldn't have won had he spent those time at home," Ram said.

As far as his son's grievance with promotion was concerned, Ram left it to the shooter.

"That is his decision and I am not going to tell him anything. I am very happy with the Army," the beaming father told reporters.

NRAI advisor Baljeet Sethi said Kumar will from now on be getting all the privileges that an Olympic medallist deserve.

"We will definitely give him all the privileges, whatever is possible. We will take him to the Prime Minister and a felicitation has been planned, it will happen once our president (Raninder Singh) is back from London," Sethi said.

Sethi felt Kumar had it in him to win even a gold medal in London. "He is a quiet type of a person. He is not like the rest, he is always focused on shooting. I had always expected him to win and he could have, in fact, won a gold also."

National coach Sunny Thomas too, was hopeful of Kumar winning a medal, but he was expecting to bag 4-5 medals.

"Realistically, I had expected 4-5 medals. But then it's okay, last time we won one, and two this time. The colour may not be gold but the numbers are more this time," Thomas said.

India had finished their shooting campaign at the Games with a silver won by Kumar and a bronze in the 10m air rifle event clinched by Gagan Narang.

Top medal hopes Abhinav Bindra, who created history four years ago in the Beijing Games with a gold medal in 10m air rifle, and trap shooter Ronjan Sodhi emerged without a podium finish.

Meanwhile, Narang arrived in Mumbai last night according to Thomas, following which he left for Pune where his academy, 'Gun for Glory', is based.

Tuesday, 8 May 2012

Android 4.0, Ice Cream Sandwich Latest version


        
Android 4.0 is the latest version of the Android platform for phones, tablets, and more.The All Apps launcher (left) and resizable widgets (right) give you apps and rich content from the home screen..New home screen folders offer a new way for you to group your apps and shortcuts logically, just by dragging one onto another. Also, in All Apps launcher, you can now simply drag an app to get information about it or immediately uninstall it, or disable a pre-installed app.
                                           Android has always been cloud-connected, letting you browse the web and sync photos, apps, games, email, and contacts — wherever you are and across all of your devices. Android 4.0 adds new browsing and email capabilities to let you take even more with them and keep communication organized.
                             Android 4.0 introduces a completely new approach to securing a device, making each person's device even more personal — Face Unlock is a new screen-lock option that lets you unlock your device with your face. It takes advantage of the device front-facing camera and state-of-the-art facial recognition technology to register a face during setup and then to recognize it again when unlocking the device. Just hold your device in front of your face to unlock, or use a backup PIN or pattern.


*Simple, Beautiful, Useful
*Refined, evolved UI
*Home screen folders and favorites tray
*Resizable widgets
*New lock screen actions
*Quick responses for incoming calls




*Swipe to dismiss notifications, tasks, and browser tabs
*Improved text input and spell-checking
*Powerful voice input engine
*Control over network data
*Rich and versatile camera capabilities
*Redesigned Gallery app with photo editor
*Live Effects for transforming video


*Powerful web browsing
*Android Beam for NFC-based sharing
*Face Unlock

Link:http://www.android.com/about/ice-cream-sandwich/

International HTC One S gets first software update V1.78







An international  version of the HTC One S not tied to a carrier are receiving a small treat today in the form of a 60MB update. Bringing the phone to firmware version 1.78.This  includes the removal of  redundant Ice Cream Sandwich  software  menu buttons in Google apps and likely a fix for WiFi  Issues reported  by some          owners.
                                     But those running an unlocked, unbranded One S can head head to Settings > About phone > Software updates to grab the latest OTA.