CME ROCKS
<<< TSECET APPLY >>> <<< APECET APPLY >>> <<< TSEAMCET APPLY >>> <<< TSPSC 1 TIME REGISTRATION HERE >>> <<< TSPSC RESULTS >>>

Tuesday, 11 August 2015

Google Chrome Shortcut keys

Ctrl+N Opens a new window.
Ctrl+T Opens a new tab.
Ctrl+Shift+N Opens a new window in incognito mode.
Press Ctrl+O, then select file. Opens a file from your computer in Google Chrome.
Press Ctrl and click a link. Or click a link with your middle mouse button (or mousewheel). Opens the link in a new tab in the background .
Press Ctrl+Shift and click a link. Or press Shift and click a link with your middle mouse button (or mousewheel). Opens the link in a new tab and switches to the newly opened tab.
Press Shift and click a link. Opens the link in a new window.
Ctrl+Shift+T Reopens the last tab you've closed. Google Chrome remembers the last 10 tabs you've closed.
Drag a link to a tab. Opens the link in the tab.
Drag a link to a blank area on the tab strip. Opens the link in a new tab.
Drag a tab out of the tab strip. Opens the tab in a new window.
Drag a tab out of the tab strip and into an existing window. Opens the tab in the existing window.
Press Esc while dragging a tab. Returns the tab to its original position.
Ctrl+1 through Ctrl+8 Switches to the tab at the specified position number on the tab strip.
Ctrl+9 Switches to the last tab.
Ctrl+Tab or Ctrl+PgDown Switches to the next tab.
Ctrl+Shift+Tab or Ctrl+PgUp Switches to the previous tab.
Alt+F4 or Ctrl + Shift + W Closes the current window.
Ctrl+W or Ctrl+F4 Closes the current tab or pop-up.
Click a tab with your middle mouse button (or mousewheel). Closes the tab you clicked.
Right-click, or click and hold either the Back or Forward arrow in the browser toolbar. Displays your browsing history in the tab.
Press Backspace, or Alt and the left arrow together. Goes to the previous page in your browsing history for the tab.
Press Shift+Backspace, or Alt and the right arrow together. Goes to the next page in your browsing history for the tab.
Press Ctrl and click either the Back arrow, Forward arrow, or Go button in the toolbar. Or click either button with your middle mouse button (or mousewheel). Opens the button destination in a new tab in the background.
Double-click the blank area on the tab strip. Maximizes or minimizes the window.
Alt+Home Opens your homepage in your current window.

Mozilla Firefox shortcut keys

Mozilla Firefox shortcut keysFirefox

Shortcut Keys Description
F5 refresh current page, frame, or tab.
F11 Display the current website in full screen mode. Pressing F11 again will exit this mode.
Esc Stop page or download from loading.
Spacebar Moves down a page at a time.
Alt + Home Open your homepage.
Alt + Down arrow Display all previous text entered in a text box and available options on drop down menu.
Alt + Left Arrow Back a page.
Alt + Right Arrow Forward a page.
Ctrl + (- or +) Increase or decrease the font size, pressing '-' will decrease and '+' will increase. Ctrl + 0 will reset back to default.
Ctrl + D Add a Bookmarkfor the page currently opened.
Ctrl + F Access the Find option, to search for any text on the currently open web page.
Ctrl + H View browsing history.
Ctrl + I Display available bookmarks.
Ctrl + J Display the download window.
Ctrl + K or Ctrl + E Move the cursor to the search box.
Ctrl + N Open New browser window.
Ctrl + O Access the Open File window to open a file in Firefox.
Ctrl + P Print current page or frame
Ctrl + T Opens a new tab.
Ctrl + F4 or Ctrl + W Closes the currently selected tab.
Ctrl + F5 Refresh the page, ignoring the Internet cache (force full refresh).
Ctrl + Enter Quickly complete an address. For example, type computerhope in the address bar and press CTRL + ENTER to get http://www.computerhope.com.
Ctrl + Tab Moves through each of the open tabs.
Ctrl + Shift + Del Open the Clear Data window to quickly clear private data.
Ctrl + Shift + Open the Bookmarks window, to view all bookmarks in Firefox.


Ctrl + Shift + P Open a new private browsing window.
Ctrl + Shift + T Undo the close of a window.
Ctrl + Shift + W Close the Firefox browser window.
Shift + Spacebar Moves up a page at a time.

Facebook Shortcut keys


Win & Chrome Win & Firefox Win & IE OSX & Firefox OSX & Other
Alt Alt + Shift Alt Function + Ctrl Option + Ctrl




M Open a new message *
? Go to the Facebook Search
1 Home (News Feed)
2 Your profile page
3 Friend requests
4 Messages
5 Notifications
6 Your Account Settings
7 Your Privacy Settings
8 Go to the Facebook page
9 View Facebook Statements and Rights agreement
0 Open Facebook help center





Friday, 17 April 2015

JNTUH CSE(2-2) JAVA LAB MANUAL

                                                                                   BY KOMAKULA RAMESH


Week :..1.....CALCULATOR PROGRAM:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class calci extends JFrame implements ActionListener
{
JLabel l1,l2,l3;
JTextField t1,t2,t3;
JButton b1,b2,b3,b4,b5,b6;
calci()
{
Container c=getContentPane();
GridLayout grid=new GridLayout(6,4,0,0);
c.setLayout(grid);
l1=new JLabel("FIRST NO:");
add(l1);
t1=new JTextField(15);
add(t1);
l2=new JLabel("SECOND NO:");
add(l2);
t2=new JTextField(15);
add(t2);
l3=new JLabel("RESULT:");
add(l3);
t3=new JTextField(15);
add(t3);
b1=new JButton("ADD");
add(b1);
b1.addActionListener(this);
b2=new JButton("SUB");
add(b2);
b2.addActionListener(this);
b3=new JButton("MUL");
add(b3);
b3.addActionListener(this);
b4=new JButton("DIV");
add(b4);
b4.addActionListener(this);
b5=new JButton("MOD");
add(b5);
b5.addActionListener(this);
b6=new JButton("CLEAR");
add(b6);
b6.addActionListener(this);

c.add(l1);
c.add(t1);
c.add(l2);
c.add(t2);
c.add(l3);
c.add(t3);
c.add(b1);
c.add(b2);
c.add(b3);
c.add(b4);
c.add(b5);
c.add(b6);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==b1)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double Sum=x+y;
t3.setText(""+Sum);
}
if(ae.getSource()==b2)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double Sub=x-y;
t3.setText(""+Sub);
}
if(ae.getSource()==b3)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double mul=x*y;
t3.setText(""+mul);
}
if(ae.getSource()==b4)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double div=x/y;
t3.setText(""+div);
}
if(ae.getSource()==b5)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double rem=x%y;
t3.setText(""+rem);
}
if(ae.getSource()==b6)
{
t1.setText("");
t2.setText("");
t3.setText("");
}
}
public static void main(String args[])
{
calci calc=new calci();
calc.setSize(200,200);
calc.setVisible(true);
}
}

OUTPUT:



Week :....3...Develop an applet in Java that receives an integer in one text field, and computes its factorial value
and returns it in another text field, when the utto a ed Co pute is li ked.


PROGRAM:
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
/*<applet code=".class" height=100 width=500></applet>*/
public class Af extends Applet implements ActionListener
{
TextField tf1;
TextField tf2;
Button b;
Label l;
public void init()
{
l=new Label("Enter the number & press the button");
tf1=new TextField("",5);
tf2=new TextField("",10);
b=new Button("compute");
add(l);
add(tf1);
add(tf2);
add(b);
b.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str=ae.getActionCommand();
String str1;
int fact=1;
if(str=="compute")
int n=Integer.parseInt(tf1.getText());
for(int i=1;i<=n;i++)
fact=fact*i;
str1=""+fact;
tf2.setText(str1);
}
}
}

EXECUTION:

C:\>javac af.java
C:\>appletviewer af.html

OUTPUT:



Week :.......Write a java program to create an absract class named Shape that contains two integers and
an empty method named PrintArea().Provide three classesnamed Rectangle,Triangle,Circle such
thatbeach one of the classes extebds the class Shape.Each one of the classes contains onlt the method
ptintArea() that prints the area of the given Shape.


PROGRAM:
import java.io.*;
import java.util.*;
abstract class Shape
{
int x=20,y=10;
abstract void printArea();
}
class Rectangle extends Shape
{
void printArea()
{
System.out.println(super.x*super.y);
}
}
class Triangle extends Shape
{
void printArea()
{
System.out.println(0.5*super.x*super.x);
}
}
class Circle extends Shape
{
void printArea()
{
System.out.println(3.1416*super.x*super.x);
}
}
class Test1
{
public static void main(String a[ ]) throws IOException
{
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the number");
String h=bf.readLine();
int ch=Integer.parseInt(h);
switch(ch)
{
case 1:
Rectangle e1=new Rectangle();
e1.printArea();

break;
case 2:
Triangle e2=new Triangle();
e2.printArea();
break;
case 3:
Circle e3=new Circle();
e3.printArea();
break;
default: System.out.println("Exited");
}
}
}
OUTPUT:



----Week :.......TRAFFIC SIGNAL
PROGRAM:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<applet code="TrafficSign.class" width=300 height=500>
</applet>*/
public class TrafficSign extends Applet implements ItemListener
{
CheckboxGroup cbg=new CheckboxGroup();
public void init()
{
Checkbox red,yellow,green;
red=new Checkbox("red",cbg,false);
yellow=new Checkbox("yellow",cbg,false);
green=new Checkbox("green",cbg,false);
add(red);
add(yellow);
add(green);
red.addItemListener(this);
yellow.addItemListener(this);
green.addItemListener(this);
}
public void update(Graphics g)
{
String msg=cbg.getSelectedCheckbox().getLabel();
String s1="red",s2="yellow",s3="green";
if(msg.equals(s1))
{
g.setColor(Color.red);
g.fillOval(100,120,80,80);

g.setColor(Color.white);
g.fillOval(100,240,80,80);
g.setColor(Color.white);
g.fillOval(100,360,80,80);
g.drawString(" Please Stop",100,100);
}
else if(msg.equals(s2))
{
g.setColor(Color.white);
g.fillOval(100,120,80,80);
g.setColor(Color.yellow);
g.fillOval(100,240,80,80);
g.setColor(Color.white);
g.fillOval(100,360,80,80);
g.drawString("Please Wait",100,230);
}
else if(msg.equals(s3))
{
g.setColor(Color.white);
g.fillOval(100,120,80,80);
g.setColor(Color.white);
g.fillOval(100,240,80,80);
g.setColor(Color.green);
g.fillOval(100,360,80,80);
g.drawString("Please GO GO.....",100,350);
}
}
public void paint(Graphics g)

{
g.drawRect(90,80,100,400);
g.fillRect(90,80,100,400);
g.setColor(Color.white);
g.drawOval(100,120,80,80);
g.fillOval(100,120,80,80);
g.drawOval(100,240,80,80);
g.fillOval(100,240,80,80);
g.drawOval(100,360,80,80);
g.fillOval(100,360,80,80);
g.drawString("Please GO...",200,200);
update(g);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
}

EXECUTION:
C:/>javac TrafficSign.java
C:/>Appletviewer Trafficsign.java

OUTPUT:
                            

Week :.......DIVIDE PROGRM WITH EXECEPTIONS
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Lab19 extends JFrame implements ActionListener
{
private TextField tf1,tf2,tf3;
private Button div;
public static void main(String args[])
{
Lab19 f=new Lab19();
f.setSize(450,500);
f.setVisible(true);
}
public Lab19()
{
setTitle("Test");
setBackground(Color.yellow);
setForeground(Color.red);
Panel p1=new Panel();
p1.setLayout(new FlowLayout());
p1.add(new Label("Number1"));
p1.add(tf1=new TextField("",3));
p1.add(new Label("Number2"));
p1.add(tf2=new TextField("",3));
p1.add(new Label("RESULT"));
p1.add(tf3=new TextField("",3));
tf3.setEditable(false);
Panel p2=new Panel();
p2.setLayout(new FlowLayout());
p2.add(div=new Button("Divide"));
setLayout(new BorderLayout(30,40));
add("Center",p1);
add("South",p2);
div.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==div)
{
int num1=(Integer.parseInt(tf1.getText().trim()));
int num2=(Integer.parseInt(tf2.getText().trim()));
int num3=0;
try
{
num3=num1/num2;
tf3.setText(String.valueOf(num3));
}
catch(RuntimeException aex)
{
JOptionPane.showMessageDialog(null,aex.getMessage());
}
}
}
}

OUTPUT:
PERFECT EXECUTION:

ARITHMETIC EXECEPTIONPERFECT EXECUTION:


NUMBER FORMAT EXECEPTION:



Week :.......SIMPLE MESSAGE IN APPLET:

import java.awt.*;
import java.applet.*;
/*<applet code="simple.class" width=600 height=500>
</applet>*/
public class simple extends Applet
{
public void init()
{
setBackground(Color.yellow);
}
public void paint(Graphics g)
{
g.drawString("Welcome To Applet",20,20);
g.drawString("This Is Komakula Ramesh",50,50);
}
}






OUTPUT:


Week :.......MOUSE HANDLING:

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/* <applet code="Lab16.class" height=500 width=500>
</applet>*/
public class Lab16 extends Applet implements MouseListener,MouseMotionListener
{
String msg;
int mouseX,mouseY;
public void init()
{
addMouseListener(this);
addMouseMotionListener(this);
msg=" ";
mouseX=0;
mouseY=0;
}
public void mouseEntered(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseEntered";
showStatus("Mouse Entered at "+mouseX+","+mouseY);
repaint();
}
public void mousePressed(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MousePressed";
showStatus("Mouse Pressed at"+mouseX+","+mouseY);
repaint();
}
public void mouseReleased(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseReleased";
showStatus("MouseReleased at"+mouseX+","+mouseY);
repaint();
}
public void mouseDragged(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseDragging";

showStatus("MouseDragging at"+mouseX+","+mouseY);
repaint();
}
public void mouseMoved(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MovingMouse";
showStatus("MovingMouse at"+me.getX()+","+me.getY());
repaint();
}
public void mouseClicked(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseClicked";
showStatus("MouseClicked at"+me.getX()+","+me.getY());
repaint();
}
public void mouseExited(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseExited";
showStatus("MouseClicked at"+me.getX()+","+me.getY());
repaint();
}
public void paint(Graphics g)
{
g.drawString(msg,mouseX,mouseY);
}
}

OUTPUT:
     


Week :.......Write a java program that implements a multi-thread application that has three threads.First
thread generates random integer every 1 second and if the value is even,second thread computes the square
of the number and prints.if the value is odd,the third thread will print the value of cube of the number.


import java.lang.*;
import java.util.*;
class Second extends Thread
{
int e;
public void run()
System.out.println(e*e);
{
}
Second(int j)
{
e=j;
}
}
class third extends Thread
{
int w;
public void run()
{
System.out.println(w*w*w);
}
third(int z)
{
w=z;
}
}
class first extends Thread
{
public void run()
{

for(int i=1;i<3;i++)
{
Random r=new Random();
int y=r.nextInt(1000);
System.out.println(y);
if(y%2==0)
{
Second s=new Second(y);
s.start();
try
{
sleep(1000);
}
catch(InterruptedException e)
{
}
}
}
try
{
sleep(1000);
}
catch(InterruptedException e)
{
}
}
}
public class dext
{
public static void main(String args[])
{
first fr=new first();
fr.start();

}
}

OUTPUT:

                                                         
                                                                       -----------------BY KOMAKULA RAMESH