Important alert: (current site time 7/15/2013 3:19:52 PM EDT)
 

VB icon

A Nice Demonstration using SWING: A TI-83 Calculator

Email
Submitted on: 12/10/2008 10:04:41 AM
By: Rayan D. 
Level: Beginner
User Rating: By 1 Users
Compatibility: Java (JDK 1.5)
Views: 6671
(About the author)
 
     This code demonstrates basic SWING skills such as creating a content pane, buttons, the use of labels, as well as text fields. Please not that the calculator is not functional and its purpose it show basic swing skills and is a design exercise. Feedback is appreciated!

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: A Nice Demonstration using SWING: A TI-83 Calculator
// Description:This code demonstrates basic SWING skills such as creating a content pane, buttons, the use of labels, as well as text fields. Please not that the calculator is not functional and its purpose it show basic swing skills and is a design exercise. Feedback is appreciated!
// By: Rayan D.
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=6215&lngWId=2//for details.//**************************************

/**
 *
 * @author Rayan Dutta
 * 
 */
import java.awt.*;
import javax.swing.*;
public class TICalc extends JFrame
{
private JLabel text, yt, normalt, zoomt, tracet, grapht, modet, delt, alphat, xt, sta, matht, appst, prgmt, vart, cleart, x2t, sint, cost, tant, pwrt, pwrt2, xsqt, comat, bracet1, bracet2, dividet, dividet2, logt, sevent, eightx, ninet, multt, mult2, lnt, fourt, fivet, sixt, plust, plus2, stot, onet, twot, threet, subt, sub2, ont, zerot, ptt, negt, enrt, enr2;
private JPanel textarea, buttonpanel;
private JTextField display;
private JButton y, normal, zoom, trace, graph, second, mode, delete, up, down, left, right, alpha, x, stat, math, apps, prgm, vars, clear, x2, sin, cos, tan, pwr, xsq, coma, brace1, brace2, divide, log, seven, eight, nine, mult, ln, four, five, six, plus, sto, one, two, three, sub, on, zero, pt, neg, enr;
public TICalc()
{
GUI();
}
public void GUI()
{
Container contentPane = getContentPane();
contentPane.setBackground(Color.BLACK);
contentPane.setLayout(null);
text = new JLabel();
text.setBounds(110, -120, 250, 250);
text.setForeground(Color.WHITE);
text.setText("TI-83 Smart Calculator");
contentPane.add(text);
display = new JTextField();
display.setBackground(Color.CYAN);
display.setHorizontalAlignment(
JTextField.CENTER);
display.setText("Rayan's TI-83 Smart Calculator");
display.setBounds(45, 30, 250, 200);
contentPane.add(display);
textarea = new JPanel();
textarea.setLayout( null );
textarea.setBounds( 40, 20, 260, 220 );
contentPane.add( textarea );
 y = new JButton();
 y.setBounds(40, 255, 55, 15);
 y.setFont(new Font("Ariel", Font.PLAIN, 8));
 y.setText("Y=");
 contentPane.add(y);
 
 yt = new JLabel();
 yt.setBounds(40, 245, 55, 15);
 yt.setFont(new Font("Ariel", Font.CENTER_BASELINE, 7));
 yt.setForeground(Color.YELLOW);
 yt.setText("STAT PLOT F1");
 contentPane.add(yt);
 
 normal = new JButton();
 normal.setBounds(95, 255, 55, 15);
 normal.setFont(new Font("Ariel", Font.PLAIN, 6));
 normal.setText("Window");
 contentPane.add(normal);
 
 normalt = new JLabel();
 normalt.setBounds(105, 245, 55, 15);
 normalt.setFont(new Font("Ariel", Font.CENTER_BASELINE, 7));
 normalt.setForeground(Color.YELLOW);
 normalt.setText("TBL SET F2");
 contentPane.add(normalt);
 
 zoom = new JButton();
 zoom.setBounds(147, 255, 55, 15);
 zoom.setFont(new Font("Ariel", Font.PLAIN, 8));
 zoom.setText("Zoom");
 contentPane.add(zoom);
 
 zoomt = new JLabel();
 zoomt.setBounds(160, 245, 55, 15);
 zoomt.setFont(new Font("Ariel", Font.CENTER_BASELINE, 7));
 zoomt.setForeground(Color.YELLOW);
 zoomt.setText("FORMAT F3");
 contentPane.add(zoomt);
 
 trace = new JButton();
 trace.setBounds(197, 255, 55, 15);
 trace.setFont(new Font("Ariel", Font.PLAIN, 8));
 trace.setText("Trace");
 contentPane.add(trace);
 
 tracet = new JLabel();
 tracet.setBounds(210, 245, 55, 15);
 tracet.setFont(new Font("Ariel", Font.CENTER_BASELINE, 7));
 tracet.setForeground(Color.YELLOW);
 tracet.setText("CALC F4");
 contentPane.add(tracet);
 
 graph = new JButton();
 graph.setBounds(247, 255, 55, 15);
 graph.setFont(new Font("Ariel", Font.PLAIN, 8));
 graph.setText("Graph");
 contentPane.add(graph);
 
 grapht = new JLabel();
 grapht.setBounds(255, 245, 55, 15);
 grapht.setFont(new Font("Ariel", Font.CENTER_BASELINE, 7));
 grapht.setForeground(Color.YELLOW);
 grapht.setText("TABLE F5");
 contentPane.add(grapht);
 second = new JButton();
 second.setBounds(45, 300, 50, 30);
 second.setFont(new Font("Ariel", Font.BOLD, 8));
 second.setText("2nd");
 second.setBackground(Color.YELLOW);
 contentPane.add(second);
 
 modet = new JLabel();
 modet.setBounds(115, 280, 50, 30);
 modet.setForeground(Color.YELLOW);
 modet.setFont(new Font("Ariel", Font.PLAIN, 7));
 modet.setText("QUIT");
 contentPane.add(modet);
 
 mode = new JButton();
 mode.setBounds(100, 300, 50, 30);
 mode.setForeground(Color.WHITE);
 mode.setFont( new Font("Ariel", Font.BOLD, 5));
 mode.setText("MODE");
 mode.setBackground(Color.BLACK);
 contentPane.add(mode);
 
 delete = new JButton();
 delete.setBounds(155, 300, 50, 30);
 delete.setForeground(Color.WHITE);
 delete.setFont(new Font("Ariel", Font.BOLD, 7));
 delete.setText("DEL");
 delete.setBackground(Color.BLACK);
 contentPane.add(delete);
 
 delt = new JLabel();
 delt.setBounds(170, 280, 50, 30);
 delt.setForeground(Color.YELLOW);
 delt.setFont(new Font("Ariel", Font.PLAIN, 7));
 delt.setText("INS");
 contentPane.add(delt);
 
 up = new JButton();
 up.setBounds(232, 295, 45, 25);
 up.setBackground(Color.BLUE);
 up.setForeground(Color.WHITE);
 up.setFont(new Font("Ariel", Font.BOLD, 10));
 up.setText("^");
 contentPane.add(up);
 
 left = new JButton();
 left.setBounds(215, 320, 40, 25);
 left.setBackground(Color.BLUE);
 left.setForeground(Color.WHITE);
 left.setFont(new Font("Ariel", Font.BOLD, 10));
 left.setText("<");
 contentPane.add(left);
 
 down = new JButton();
 down.setBounds(232, 345, 45, 25);
 down.setBackground(Color.BLUE);
 down.setForeground(Color.WHITE);
 down.setFont(new Font("Ariel", Font.PLAIN, 10));
 down.setText("V");
 contentPane.add(down);
 
 right = new JButton();
 right.setBounds(255, 320, 40, 25);
 right.setBackground(Color.blue);
 right.setForeground(Color.WHITE);
 right.setFont(new Font("Ariel", Font.BOLD, 10));
 right.setText(">");
 contentPane.add(right);
 
 alpha = new JButton();
 alpha.setBounds(45, 345, 50, 30);
 alpha.setBackground(Color.GREEN);
 alpha.setFont(new Font("Ariel", Font.PLAIN, 7));
 alpha.setForeground(Color.WHITE);
 alpha.setText("A");
 contentPane.add(alpha);
 
 alphat = new JLabel();
 alphat.setBounds(55, 325, 50, 30);
 alphat.setFont(new Font("Ariel", Font.PLAIN, 7));
 alphat.setForeground(Color.YELLOW);
 alphat.setText("A-LOCK");
 contentPane.add(alphat);
 
 x = new JButton();
 x.setBounds(100, 345, 50, 30);
 x.setFont(new Font("Ariel", Font.BOLD, 7));
 x.setForeground(Color.WHITE);
 x.setBackground(Color.BLACK);
 x.setText("X");
 contentPane.add(x);
 
 xt = new JLabel();
 xt.setBounds(115, 325, 50, 30);
 xt.setForeground(Color.YELLOW);
 xt.setFont(new Font("Ariel", Font.BOLD, 7));
 xt.setText("LINK");
 contentPane.add(xt);
 
 stat = new JButton();
 stat.setBounds(155, 345, 50, 30);
 stat.setForeground(Color.WHITE);
 stat.setBackground(Color.BLACK);
 stat.setFont(new Font("Ariel", Font.BOLD, 6));
 stat.setText("STAT");
 contentPane.add(stat);
 
 sta = new JLabel();
 sta.setBounds(165, 325, 50, 30);
 sta.setForeground(Color.YELLOW);
 sta.setFont(new Font("Ariel", Font.BOLD, 7));
 sta.setText("LIST");
 contentPane.add(sta);
 
 math = new JButton();
 math.setBounds(45, 390, 50, 30);
 math.setForeground(Color.WHITE);
 math.setBackground(Color.BLACK);
 math.setFont(new Font("Ariel", Font.BOLD, 5));
 math.setText("MATH");
 contentPane.add(math);
 
 matht = new JLabel();
 matht.setBounds(50, 370, 50, 30);
 matht.setForeground(Color.YELLOW);
 matht.setFont( new Font("Ariel", Font.BOLD, 7));
 matht.setText("TESTA");
 contentPane.add(matht);
 
 apps = new JButton();
 apps.setBounds(100, 390, 50, 30);
 apps.setFont(new Font("Ariel", Font.BOLD, 6));
 apps.setForeground(Color.WHITE);
 apps.setBackground(Color.BLUE);
 apps.setText("APPS");
 contentPane.add(apps);
 
 appst = new JLabel();
 appst.setBounds(105, 370, 50, 30);
 appst.setForeground(Color.YELLOW);
 appst.setFont(new Font("Ariel", Font.BOLD, 7));
 appst.setText("ANGLE B");
 contentPane.add(appst);
 
 prgm = new JButton();
 prgm.setBounds(155, 390, 50, 30);
 prgm.setForeground(Color.WHITE);
 prgm.setBackground(Color.BLACK);
 prgm.setFont(new Font("Ariel", Font.BOLD, 5));
 prgm.setText("PRGM");
 contentPane.add(prgm);
 
 prgmt = new JLabel();
 prgmt.setBounds(160, 370, 50, 30);
 prgmt.setForeground(Color.YELLOW);
 prgmt.setFont(new Font("Ariel", Font.BOLD, 7));
 prgmt.setText("DRAWC");
 contentPane.add(prgmt);
 
 vars = new JButton();
 vars.setBounds(210, 390, 50, 30);
 vars.setForeground(Color.WHITE);
 vars.setBackground(Color.BLACK);
 vars.setFont(new Font("Ariel", Font.BOLD, 6));
 vars.setText("VARS");
 contentPane.add(vars);
 
 vart = new JLabel();
 vart.setBounds(215, 370, 50, 30);
 vart.setForeground(Color.YELLOW);
 vart.setFont(new Font("Ariel", Font.BOLD, 7));
 vart.setText("DISTR");
 contentPane.add(vart);
 
 cleart = new JLabel();
 cleart.setBounds(278, 390, 34, 30);
 cleart.setForeground(Color.WHITE);
 cleart.setFont(new Font("Ariel", Font.BOLD, 7));
 cleart.setText("CL");
 contentPane.add(cleart);
 
 clear = new JButton();
 clear.setBounds(265, 390, 34, 30);
 clear.setBackground(Color.BLACK);
 clear.setForeground(Color.WHITE);
 contentPane.add(clear);
 
x2 = new JButton();
x2.setBounds(45, 435, 50, 30);
x2.setBackground(Color.BLACK);
x2.setForeground(Color.WHITE);
x2.setFont(new Font("Ariel", Font.BOLD, 7));
x2.setText("X^-1");
contentPane.add(x2);
x2t = new JLabel();
x2t.setBounds(50, 415, 50, 30);
x2t.setForeground(Color.YELLOW);
x2t.setFont(new Font("Ariel", Font.BOLD, 7));
x2t.setText("MATRIX D");
contentPane.add(x2t);
 
sin = new JButton();
sin.setBounds(100, 435, 50, 30);
sin.setForeground(Color.WHITE);
sin.setBackground(Color.BLACK);
sin.setFont(new Font("Ariel", Font.BOLD, 7));
sin.setText("SIN");
contentPane.add(sin);
sint = new JLabel();
sint.setBounds(105, 415, 50, 30);
sint.setForeground(Color.YELLOW);
sint.setBackground(Color.BLACK);
sint.setFont(new Font("Ariel", Font.BOLD, 7));
sint.setText("SIN^-1 E");
contentPane.add(sint);
cos = new JButton();
cos.setBounds(155, 435, 50, 30);
cos.setForeground(Color.WHITE);
cos.setBackground(Color.BLACK);
cos.setFont(new Font("Ariel", Font.BOLD, 7));
cos.setText("COS");
contentPane.add(cos);
cost = new JLabel();
cost.setBounds(160, 415, 50, 30);
cost.setForeground(Color.YELLOW);
cost.setFont(new Font("Ariel", Font.BOLD, 7));
cost.setText("COS^-1 F");
contentPane.add(cost);
tan = new JButton();
tan.setBounds(210, 435, 50, 30);
tan.setForeground(Color.WHITE);
tan.setBackground(Color.BLACK);
tan.setFont(new Font("Ariel", Font.BOLD, 7));
tan.setText("TAN");
contentPane.add(tan);
tant = new JLabel();
tant.setBounds(215, 415, 50, 30);
tant.setForeground(Color.YELLOW);
tant.setFont(new Font("Ariel", Font.BOLD, 7));
tant.setText("TAN^-1 G");
contentPane.add(tant);
 pwrt = new JLabel();
 pwrt.setBounds(280, 435, 34, 30);
 pwrt.setForeground(Color.WHITE);
 pwrt.setFont(new Font("Ariel", Font.BOLD, 10));
 pwrt.setText("^");
 contentPane.add(pwrt);
pwr = new JButton();
pwr.setBounds(265, 435, 34, 30);
pwr.setBackground(Color.BLACK);
pwr.setForeground(Color.WHITE);
 contentPane.add(pwr);
 
pwrt2 = new JLabel();
pwrt2.setBounds(270, 415, 34, 30);
pwrt2.setForeground(Color.YELLOW);
pwrt2.setFont(new Font("Ariel", Font.BOLD, 7));
pwrt2.setText("Pi H");
contentPane.add(pwrt2);
xsq = new JButton();
xsq.setBounds(45, 480, 50, 30);
xsq.setForeground(Color.WHITE);
xsq.setBackground(Color.BLACK);
xsq.setFont(new Font("Ariel", Font.BOLD, 7));
xsq.setText("X^2");
contentPane.add(xsq);
xsqt = new JLabel();
xsqt.setBounds(45, 460, 50, 30);
xsqt.setForeground(Color.YELLOW);
xsqt.setFont(new Font("Ariel", Font.BOLD, 7));
xsqt.setText("SquareRootI");
contentPane.add(xsqt);
coma = new JButton();
coma.setBounds(100, 480, 50, 30);
coma.setForeground(Color.WHITE);
coma.setBackground(Color.BLACK);
coma.setFont(new Font("Ariel", Font.BOLD, 15));
coma.setText(",");
contentPane.add(coma);
comat = new JLabel();
comat.setBounds(105, 460, 50, 30);
comat.setForeground(Color.YELLOW);
comat.setFont(new Font("Ariel", Font.BOLD, 7));
comat.setText("EE J");
contentPane.add(comat);
brace1 = new JButton();
brace1.setBounds(155, 480, 50, 30);
brace1.setForeground(Color.WHITE);
brace1.setBackground(Color.BLACK);
brace1.setFont(new Font("Ariel", Font.BOLD, 13));
brace1.setText("(");
contentPane.add(brace1);
bracet1 = new JLabel();
bracet1.setBounds(160, 460, 50, 30);
bracet1.setForeground(Color.YELLOW);
bracet1.setFont(new Font("Ariel", Font.BOLD, 7));
bracet1.setText("{K");
contentPane.add(bracet1);
brace2 = new JButton();
brace2.setBounds(210, 480, 50, 30);
brace2.setForeground(Color.WHITE);
brace2.setBackground(Color.BLACK);
brace2.setFont(new Font("Ariel", Font.BOLD, 13));
brace2.setText(")");
contentPane.add(brace2);
bracet2 = new JLabel();
bracet2.setBounds(215, 460, 50, 30);
bracet2.setForeground(Color.YELLOW);
bracet2.setFont(new Font("Ariel", Font.BOLD, 7));
bracet2.setText("}L");
contentPane.add(bracet2);
dividet = new JLabel();
dividet.setBounds(280, 480, 34, 30);
dividet.setForeground(Color.WHITE);
dividet.setFont(new Font("Ariel", Font.BOLD, 15));
dividet.setText("/");
contentPane.add(dividet);
divide = new JButton();
divide.setBounds(265, 480, 34, 30);
divide.setForeground(Color.WHITE);
divide.setBackground(Color.BLUE);
contentPane.add(divide);
dividet2 = new JLabel();
dividet2.setBounds(265, 460, 34, 30);
dividet2.setForeground(Color.YELLOW);
dividet2.setFont(new Font("Ariel", Font.BOLD, 7));
dividet2.setText("Degree M");
contentPane.add(dividet2);
log = new JButton();
log.setBounds(45, 525, 50, 30);
log.setForeground(Color.WHITE);
log.setBackground(Color.BLACK);
log.setFont(new Font("Ariel", Font.BOLD, 7));
log.setText("LOG");
contentPane.add(log);
logt = new JLabel();
logt.setBounds(45, 505, 50, 30);
logt.setForeground(Color.YELLOW);
logt.setFont(new Font("Ariel", Font.BOLD, 7));
logt.setText("10^XN");
contentPane.add(logt);
seven = new JButton();
seven.setBounds(100, 525, 50, 30);
seven.setForeground(Color.BLACK);
seven.setBackground(Color.WHITE);
seven.setFont(new Font("Ariel", Font.BOLD, 10));
seven.setText("7");
contentPane.add(seven);
sevent = new JLabel();
sevent.setBounds(105, 505, 50, 30);
sevent.setForeground(Color.YELLOW);
sevent.setFont(new Font("Ariel", Font.BOLD, 7));
sevent.setText("uO");
contentPane.add(sevent);
eight = new JButton();
eight.setBounds(155, 525, 50, 30);
eight.setForeground(Color.BLACK);
eight.setBackground(Color.WHITE);
eight.setFont(new Font("Ariel", Font.BOLD, 10));
eight.setText("8");
contentPane.add(eight);
eightx = new JLabel();
eightx.setBounds(160, 505, 50, 30);
eightx.setForeground(Color.YELLOW);
eightx.setFont(new Font("Ariel", Font.BOLD, 7));
eightx.setText("VP");
contentPane.add(eightx);
nine = new JButton();
nine.setBounds(210, 525, 50, 30);
nine.setForeground(Color.BLACK);
nine.setBackground(Color.WHITE);
nine.setFont(new Font("Ariel", Font.BOLD, 10));
nine.setText("9");
contentPane.add(nine);
ninet = new JLabel();
ninet.setBounds(215, 505, 50, 30);
ninet.setForeground(Color.YELLOW);
ninet.setFont(new Font("Ariel", Font.BOLD, 7));
ninet.setText("WQ");
contentPane.add(ninet);
mult2 = new JLabel();
mult2.setBounds(279, 525, 34,30);
mult2.setForeground(Color.WHITE);
mult2.setFont(new Font("Ariel", Font.BOLD, 10));
mult2.setText("X");
contentPane.add(mult2);
mult = new JButton();
mult.setBounds(265, 525, 34, 30);
mult.setForeground(Color.WHITE);
mult.setBackground(Color.BLUE);
contentPane.add(mult);
multt = new JLabel();
multt.setBounds(270, 505, 34, 30);
multt.setForeground(Color.YELLOW);
multt.setFont(new Font("Ariel", Font.BOLD, 7));
multt.setText("[ R");
contentPane.add(multt);
ln = new JButton();
ln.setBounds(45, 570, 50, 30);
ln.setForeground(Color.WHITE);
ln.setBackground(Color.BLACK);
ln.setFont(new Font("Ariel", Font.BOLD, 7));
ln.setText("LN");
contentPane.add(ln);
lnt = new JLabel();
lnt.setBounds(50, 550, 50, 30);
lnt.setForeground(Color.YELLOW);
lnt.setFont(new Font("Ariel", Font.BOLD, 7));
lnt.setText("e^X S");
contentPane.add(lnt);
four = new JButton();
four.setBounds(100, 570, 50, 30);
four.setForeground(Color.BLACK);
four.setBackground(Color.WHITE);
four.setFont(new Font("Ariel", Font.BOLD, 10));
four.setText("4");
contentPane.add(four);
fourt = new JLabel();
fourt.setBounds(105, 550, 50, 30);
fourt.setForeground(Color.YELLOW);
fourt.setFont(new Font("Ariel", Font.BOLD, 7));
fourt.setText("L4 T");
contentPane.add(fourt);
five = new JButton();
five.setBounds(155, 570, 50, 30);
five.setForeground(Color.BLACK);
five.setBackground(Color.WHITE);
five.setFont(new Font("Ariel", Font.BOLD, 10));
five.setText("5");
contentPane.add(five);
fivet = new JLabel();
fivet.setBounds(160, 550, 50, 30);
fivet.setForeground(Color.YELLOW);
fivet.setFont(new Font("Ariel", Font.BOLD, 7));
fivet.setText("L5 U");
contentPane.add(fivet);
six = new JButton();
six.setBounds(210, 570, 50, 30);
six.setForeground(Color.BLACK);
six.setBackground(Color.WHITE);
six.setFont(new Font("Ariel", Font.BOLD, 10));
six.setText("6");
contentPane.add(six);
sixt = new JLabel();
sixt.setBounds(215, 550, 50, 30);
sixt.setForeground(Color.YELLOW);
sixt.setFont(new Font("Ariel", Font.BOLD, 7));
sixt.setText("L6V");
contentPane.add(sixt);
plus2 = new JLabel();
plus2.setBounds(279, 570, 34, 30);
plus2.setForeground(Color.WHITE);
plus2.setFont(new Font("Ariel", Font.BOLD, 10));
plus2.setText("+");
contentPane.add(plus2);
plus = new JButton();
plus.setBounds(265, 570, 34, 30);
plus.setForeground(Color.WHITE);
plus.setBackground(Color.BLUE);
contentPane.add(plus);
plust = new JLabel();
plust.setBounds(270, 550, 34, 30);
plust.setForeground(Color.YELLOW);
plust.setFont(new Font("Ariel", Font.BOLD, 7));
plust.setText("] W");
contentPane.add(plust);
sto = new JButton();
sto.setBounds(45, 615, 50, 30);
sto.setForeground(Color.WHITE);
sto.setBackground(Color.BLACK);
sto.setFont(new Font("Ariel", Font.BOLD, 7));
sto.setText("STO");
contentPane.add(sto);
stot = new JLabel();
stot.setBounds(50, 595, 50, 30);
stot.setForeground(Color.YELLOW);
stot.setFont(new Font("Ariel", Font.BOLD, 7));
stot.setText("INCL X");
contentPane.add(stot);
one = new JButton();
one.setBounds(100, 615, 50, 30);
one.setForeground(Color.BLACK);
one.setBackground(Color.WHITE);
one.setFont(new Font("Ariel", Font.BOLD, 10));
one.setText("1");
contentPane.add(one);
onet = new JLabel();
onet.setBounds(105, 595, 50, 30);
onet.setForeground(Color.YELLOW);
onet.setFont(new Font("Ariel", Font.BOLD, 7));
onet.setText("L1X");
contentPane.add(onet);
two = new JButton();
two.setBounds(155, 615, 50, 30);
two.setForeground(Color.BLACK);
two.setBackground(Color.WHITE);
two.setFont(new Font("Ariel", Font.BOLD, 10));
two.setText("2");
contentPane.add(two);
twot = new JLabel();
twot.setBounds(160, 595, 50, 30);
twot.setForeground(Color.YELLOW);
twot.setFont(new Font("Ariel", Font.BOLD, 7));
twot.setText("L2 Y");
contentPane.add(twot);
three = new JButton();
three.setBounds(210, 615, 50, 30);
three.setForeground(Color.BLACK);
three.setBackground(Color.WHITE);
three.setFont(new Font("Ariel", Font.BOLD, 10));
three.setText("3");
contentPane.add(three);
threet = new JLabel();
threet.setBounds(215, 595, 50, 30);
threet.setForeground(Color.YELLOW);
threet.setFont(new Font("Ariel", Font.BOLD, 7));
threet.setText("L3 Z");
contentPane.add(threet);
sub2 = new JLabel();
sub2.setBounds(279, 615, 34, 30);
sub2.setForeground(Color.WHITE);
sub2.setFont(new Font("Ariel", Font.PLAIN, 20));
sub2.setText("-");
contentPane.add(sub2);
sub = new JButton();
sub.setBounds(265, 615, 34, 30);
sub.setForeground(Color.WHITE);
sub.setBackground(Color.BLUE);
contentPane.add(sub);
subt = new JLabel();
subt.setBounds(270, 595, 34, 30);
subt.setForeground(Color.YELLOW);
subt.setFont(new Font("Ariel", Font.BOLD, 7));
subt.setText("MEM\"");
contentPane.add(subt);
on = new JButton();
on.setBounds(45, 660, 50, 30);
on.setForeground(Color.WHITE);
on.setBackground(Color.BLACK);
on.setFont(new Font("Ariel", Font.BOLD, 7));
on.setText("ON");
contentPane.add(on);
ont = new JLabel();
ont.setBounds(50, 640, 50, 30);
ont.setForeground(Color.YELLOW);
ont.setFont(new Font("Ariel", Font.BOLD, 7));
ont.setText("OFF");
contentPane.add(ont);
zero = new JButton();
zero.setBounds(100, 660, 50, 30);
zero.setForeground(Color.BLACK);
zero.setBackground(Color.WHITE);
zero.setFont(new Font("Ariel", Font.BOLD, 10));
zero.setText("0");
contentPane.add(zero);
zerot = new JLabel();
zerot.setBounds(105, 640, 50, 30);
zerot.setForeground(Color.YELLOW);
zerot.setFont(new Font("Ariel", Font.BOLD, 7));
zerot.setText("CATALOG_");
contentPane.add(zerot);
pt = new JButton();
pt.setBounds(155, 660, 50, 30);
pt.setForeground(Color.BLACK);
pt.setBackground(Color.WHITE);
pt.setFont(new Font("Ariel", Font.BOLD, 10));
pt.setText(".");
contentPane.add(pt);
ptt = new JLabel();
ptt.setBounds(160, 640, 50, 30);
ptt.setForeground(Color.YELLOW);
ptt.setFont(new Font("Ariel", Font.BOLD, 7));
ptt.setText("| :");
contentPane.add(ptt);
neg = new JButton();
neg.setBounds(210, 660, 50, 30);
neg.setForeground(Color.BLACK);
neg.setBackground(Color.WHITE);
neg.setFont(new Font("Ariel", Font.PLAIN, 10));
neg.setText("( - )");
contentPane.add(neg);
negt = new JLabel();
negt.setBounds(220, 640, 50, 30);
negt.setForeground(Color.YELLOW);
negt.setFont(new Font("Ariel", Font.BOLD, 7));
negt.setText("ANS?");
contentPane.add(negt);
enr2 = new JLabel();
enr2.setBounds(270, 660, 34, 30);
enr2.setForeground(Color.WHITE);
enr2.setFont(new Font("Ariel", Font.BOLD, 7));
enr2.setText("ENTER");
contentPane.add(enr2);
enr = new JButton();
enr.setBounds(265, 660, 34, 30);
enr.setForeground(Color.WHITE);
enr.setBackground(Color.BLUE);
contentPane.add(enr);
enrt = new JLabel();
enrt.setBounds(270, 640, 34, 30);
enrt.setForeground(Color.YELLOW);
enrt.setFont(new Font("Ariel", Font.BOLD, 4));
enrt.setText("ENTRY SOLVE");
contentPane.add(enrt);
buttonpanel = new JPanel();
buttonpanel.setLayout(null);
buttonpanel.setBackground(Color.DARK_GRAY);
buttonpanel.setBounds( 40, 290, 260, 420);
contentPane.add(buttonpanel);
setTitle("TI-83 Calculator by Rayan Dutta");
setLocation(500,0);
setSize(350, 770);
setVisible(true);
}
public static void main(String[] args) {
TICalc application = new TICalc();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// TODO code application logic here
}
}


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
4/3/2011 7:17:56 AMjoaquim costa

Hellod Rayan!

Great Sample.Very good work!!

Now the challenge is put it working....

Best regards

Joaquim
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.