Sensoria Tour

Calculator in Java PDF Print E-mail
User Rating: / 1
PoorBest 
Written by ravi   
Monday, 10 August 2009 18:51
Article Index
Calculator in Java
class about us
Page 3
Page 4
Page 5
Page 6
treeframe for helpmenu
All Pages
import javax.swing.tree.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class aboutus extends JFrame implements ActionListener
{
JPanel p2;
JLabel l2;
JLabel l3;
JLabel l4;
JLabel l5;
JButton bok;
aboutus()
{
p2=new JPanel();
l2=new JLabel("Calculator in Java");
l3=new JLabel("Version 1.0");
l4=new JLabel("Copyright (c) 2009 Ravi Maggon");
l5=new JLabel("Memory Used By The Calculator is 15.2 KB");
//t2=new JTextField(25);
l2.setHorizontalAlignment(JTextField.LEADING);
l3.setHorizontalAlignment(JTextField.LEADING);
l4.setHorizontalAlignment(JTextField.LEADING);
l5.setHorizontalAlignment(JTextField.LEADING);
//t2.setText("Copyright Ravi Maggon,2009");
bok=new JButton("OK");
p2.setLayout(null);
l2.setBounds(5,10,295,20);
l3.setBounds(5,30,295,20);
l4.setBounds(5,50,295,20);
l5.setBounds(5,70,295,20);
bok.setBounds(230,100,70,25);
setLocation(450,300);
p2.add(l2);p2.add(l3);p2.add(l4);p2.add(l5);
p2.add(bok);
add(p2);
//t2.setEditable(false);
setSize(315,170);
setVisible(true);setResizable(false);
setTitle("About Calculator");
bok.addActionListener(this);
}
public void actionPerformed(ActionEvent e1)
{
if(e1.getSource()==bok)
{
setVisible(false);
}
}
class winadaptabout extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
System.exit(1);
}
public void windowDeiconified(WindowEvent we)
{
setSize(315,245);
}
}
}

Last Updated on Friday, 28 August 2009 14:47
 

User Login

Who's Online

We have 13 guests online