StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Java Programming - Math Problem Example

Cite this document
Summary
The current paper "Java Programming" is primarily purposed to give a full Java program on the assignment on Programming. This particular program fully satisfies standards and rules of programming and is also good enough for degree level assignment…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER96.6% of users find it useful
Java Programming
Read Text Preview

Extract of sample "Java Programming"

/* Java Swing Calculator import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JOptionPane; public class Calculator extends JFrame implements ActionListener { // Variables final int MAX_INPUT_LENGTH = 20; final int INPUT_MODE = 0; final int RESULT_MODE = 1; final int ERROR_MODE = 2; int displayMode; boolean clearOnNextDigit, percent; double lastNumber; String lastOperator; private JMenu jmenuFile, jmenuEdit, jmenuView, jmenuHelp; private JMenuItem jmenuitemExit, jmenuitemCopy, jmenuitemPaste, jmenuitemStd, jmenuitemSci, jmenuitemDigitGrp, jmenuitemAbout; private JDialog dialog; private JLabel display; private JButton button[]; private JPanel masterPanel; private JTextArea textarea; Font f12 = new Font("Times New Roman", 0, 12); Font f121 = new Font("Times New Roman", 1, 12); Font f10 = new Font("Times New Roman", 0, 10); // Constructor public Calculator() { //Set Up the JMenuBar /* jmenuFile = new JMenu("File"); jmenuFile.setFont(f121);*/ /* jmenuitemExit = new JMenuItem("Exit"); jmenuitemExit.setFont(f12); jmenuFile.add(jmenuitemExit);*/ jmenuEdit = new JMenu("Edit"); jmenuEdit.setFont(f121); jmenuitemCopy = new JMenuItem("Copy"); jmenuitemCopy.setFont(f12); jmenuitemPaste = new JMenuItem("Paste"); jmenuitemPaste.setFont(f12); jmenuEdit.add(jmenuitemCopy); jmenuEdit.add(jmenuitemPaste); jmenuView = new JMenu("View"); jmenuView.setFont(f121); jmenuitemStd = new JMenuItem("Standard"); jmenuitemStd.setFont(f12); jmenuitemSci = new JMenuItem("Scientific"); jmenuitemSci.setFont(f12); jmenuitemDigitGrp = new JMenuItem("Digit Grouping"); jmenuitemDigitGrp.setFont(f12); jmenuView.add(jmenuitemStd); jmenuView.add(jmenuitemSci); jmenuView.addSeparator(); jmenuView.add(jmenuitemDigitGrp); jmenuHelp = new JMenu("Help"); jmenuHelp.setFont(f121); jmenuitemAbout = new JMenuItem("About Calculator"); jmenuitemAbout.setFont(f12); jmenuHelp.add(jmenuitemAbout); JMenuBar mb = new JMenuBar(); // mb.add(jmenuFile); mb.add(jmenuEdit); mb.add(jmenuView); mb.add(jmenuHelp); setJMenuBar(mb); //Set frame layout manager setBackground(Color.gray); /* * Font(String name, int style, int size) Creates a new Font from the specified name, style and point size. */ //adds menubar to frame (end) masterPanel = new JPanel(); display = new JLabel("0"); display.setAlignmentX(JLabel.RIGHT); display.setBackground(Color.gray); Container contentPane = getContentPane(); // Add components to frame contentPane.add(display, BorderLayout.NORTH); button = new JButton[23]; JPanel backSpace = new JPanel(); backSpace.setLayout(new GridLayout(1, 1, 2, 2)); button[20] = new JButton("Backspace"); backSpace.add(button[20]); JPanel control = new JPanel(); control.setLayout(new GridLayout(1, 2, 2 ,2)); button[21] = new JButton(" CE "); button[22] = new JButton("C"); control.add(button[21]); control.add(button[22]); contentPane.setLayout(new BorderLayout()); setTitle("Calculator"); setSize(241, 217); setLocation(400, 250); setVisible(true); setResizable(false); JPanel keyPad = new JPanel(); // container for buttons // Create numeric buttons for (int i=0; i Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Java Programming Math Problem Example | Topics and Well Written Essays - 1250 words”, n.d.)
Java Programming Math Problem Example | Topics and Well Written Essays - 1250 words. Retrieved from https://studentshare.org/logic-programming/1508771-java-programming
(Java Programming Math Problem Example | Topics and Well Written Essays - 1250 Words)
Java Programming Math Problem Example | Topics and Well Written Essays - 1250 Words. https://studentshare.org/logic-programming/1508771-java-programming.
“Java Programming Math Problem Example | Topics and Well Written Essays - 1250 Words”, n.d. https://studentshare.org/logic-programming/1508771-java-programming.
  • Cited: 0 times

CHECK THESE SAMPLES OF Java Programming

Popularity of Java Programming Language

Popularity of Java Name Institution Popularity of Java Over years, Java Programming language has had a steady growth as a popular development language.... This implies that Java Programming give developers that assurance that their software will handle memory efficiency and avoid runtime errors that could crash the application.... As compared to other programming languages like C#, PHP, Perl, Python or C++, Java has a significant following given that many developers prefer using this programming language to complete their projects....
4 Pages (1000 words) Research Paper

Java programming and written exercises

String[] strArr = {"Java", "programming", "if", "array","LinkedList", "queue", "iterator"};LinkedList myList = new LinkedList();private int i;for(i=0;i 5) { Insert(string strArr[i], LinkedListIterator p);}}public voidinsert(stringx,LinkedListIteratorp){ if(p!... The following program provides the partial java code for the class Account declaration.... Part of the java code has been provided as below.... Write a java code segment that uses the LinkedList myList and the String array strArr....
3 Pages (750 words) Essay

My Desire to Enter to Wake Forest University

In addition, I have worked extensively with Lotus Domino Notes, MS Access Databases creation for accounting, SQL Server, Java Programming, and VB.... et programming.... The author of the essay “My Desire to Enter to Wake Forest University” describes his dream of becoming a CPA and succeeding in WFU MSA program and the efforts he is making to achieve it: perfecting his IT skills, working with database and accounting programs and fluent English mastering....
1 Pages (250 words) Admission/Application Essay

Introduction to Java Programming

The first row in the library class diagram contains the java Program: Library Application (Section) Due) Introduction It involves the development of a library application which forms part of an upgrade initiative with two main users as the borrowers and the employee with employees interacting with the application more than the borrowers....
2 Pages (500 words) Research Paper

Object Oriented Programming

Java Programming.... This is in marked contrast to procedural programming where program flow is given the central focus.... In object –oriented programming, the… These data elements are modeled as classes and they are active entities that can manipulate the data contained in themselves and in other classes.... Finally, the system behavior is modeled after the interactions of these data items of the of the of the Object Oriented programming Object oriented programming is a programming methodology, where data and its interactions are of central focus rather than processes....
1 Pages (250 words) Essay

History of Java / History of CPU Speed (clock rate)

The Java Programming language was started in the early 90's by a team led by James Gosling at Sun Microsystems as a means to implement virtual machination as an improvement of C++.... , and is used in different machines and applications, especially over Internet Java Programming The Java Programming language was started in the early 90's by a team led by James Gosling at Sun Microsystems as a means to implement virtual machination as an improvement of C++....
1 Pages (250 words) Essay

Java technology related to this tool

Last, but by no means the least, Java Programming language can be useful in the designing and maintenance of the money tracker because of its simplicity.... In the first place, java is a very reliable programming language which can be much suitable for this tool.... In the first place, java is a very reliable programming language which can be much suitable for this tool.... Unlike other programming languages such as C++, java has a highly protected interpreter, compiler, compatible browser and runtime environment....
1 Pages (250 words) Essay

Arrays Program Issues

This paper consist of a program which initializes the array with the appropriate number of values determining the value in the array element when the index contain 2 and calculating the sum of the total miles one spent running over the 10.... … This paper consist of a program which initializes the array with the appropriate number of values determining the value in the array element when the index contain 2 and calculating the sum of the total miles one spent running over the 10....
1 Pages (250 words) Essay
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us