Welcome, Guest. Please login or register.

Author Topic: Calculator i started but never finished lol  (Read 857 times)

Offline Immortal

  • Major
  • ***
  • Posts: 203
    • View Profile
Calculator i started but never finished lol
« on: July 07, 2012, 11:31:03 am »
Here's a calculator i started coding like 2 months ago but never finished it because I was lazy..
This is what I had so far. Might finish it today though :)


Code: [Select]
/**
 * Info
 * @author [eG] Clown
 */
import java.awt.*;
import java.awt.event.*;

import javax.swing.*;


public class Calculator{

cWindow win = new cWindow();

public static void main(String argsp[]){

}

public class cWindow extends JFrame implements ActionListener{

JTextField t = new JTextField("0", 20);
JButton one = new JButton("1");
JButton two = new JButton("2");
JButton three = new JButton("3");
JButton four = new JButton("4");
JButton five = new JButton("5");
JButton six = new JButton("6");
JButton seven = new JButton("7");
JButton eight = new JButton("8");
JButton nine = new JButton("9");
JButton zero = new JButton("0");
JButton clear = new JButton("Clear");
JButton multiply = new JButton("*");
JButton divide = new JButton("/");
JButton plus = new JButton("+");
JButton minus = new JButton("-");
JButton percent = new JButton("%");
JButton dot = new JButton(".");
JButton equals = new JButton("=");



public cWindow(){
super("Calculator");
setSize(100,300);
setVisible(true);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Container cont = new Container();
FlowLayout fl = new FlowLayout();

cont = getContentPane();

}

@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub

}

}
}

Offline Csaba

  • [eG] Clan Member
  • General
  • ***
  • Posts: 644
    • View Profile
Re: Calculator i started but never finished lol
« Reply #1 on: July 07, 2012, 12:08:30 pm »
It is started? :D There is just author name and the java class name or you include window and you put out the buttons.
« Last Edit: July 07, 2012, 03:58:55 pm by Csaba »