JTable - Amortization Schedule Calculator

Jan 26, 2014

I am creating an amortization schedule calculator and I'm having a bit of trouble with adding my table to the screen after I calculate everything.

Here's my code. The problem is that in the calculatePayments() method, I want the JTable to be added to the JScrollPane but it doesn't seem to be working.

Java Code:

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

[Code] .....

View Replies


ADVERTISEMENT

Mortgage Amortization Calculator

Feb 11, 2015

import java.util.Scanner;
public class Project1 {
private static int interestYears;
private static int numberYears;
public int interest;
private static double intresetMonth;

[Code] ....

View Replies View Related

Amortization Algorithm - Loan Calculator That Uses Compound Interest

May 21, 2014

I'm making a loan calculator that uses compound interest... I need the program to return the monthly payment, how much of it is principal and how much of it is interest, which depends on how many months into your loan you are... So basically all I need is the algorithm to calculate how much of your monthly payment (depending on how many months in you are) is interest and how much of it is principal.

View Replies View Related

Printing Amortization Table For Program

Jul 15, 2014

I am still having trouble with printing an amortization table for my program. This is the example the professor gave us and our program has to print exactly like this:

Please enter the amount of the loan (a number less than $1,000,000.00) 1000.00
Please enter the annual interest rate (between 2.0 and 15.0 inclusive) 10
Please enter the term of the loan (a number of years between 1 and 30 inclusive) 1
Your monthly payment is 87.92
| INTEREST | PRINCIPAL
MONTH 1 : 8.33 79.58
MONTH 2 : 7.67 80.25

[code]....

So far I have it so it works up to the table. How to get it to loop so it will print each month with the principal and interest. This is the part im having trouble with:

double principal = amount;
double principalPaid;
double interest;
double totalInterest;
double balance = amount;

[code]....

View Replies View Related

JSP :: Windows Schedule Task Dashboard

Jun 5, 2014

I want to create a Web page which can monitor and display the status of Schedule Tasks setup on different remote machine. This Dashboard should also has the capability to re-run the schedule task.

I know that I can achieve this via Runtime class by running schtasks /Query and get all the details. But I just wanted to know if we have any other better way to do this.

View Replies View Related

JSF :: Event Calendar With Component P - Schedule Of Primefaces

Jun 20, 2014

I have a problem to display a popup with the information of the registered event. I would like the user to hover over a particular event exhibited only the description of the event without having to click on the event to view information. I would like to make an ajax request to that was displayed a popup.

But do not know how to implement jquery and javascript. Well, I am new to programming. My code that generates the schedule is as follows:

<p: schedule value = "#{bean.datamodel}" widgetVar = "sheldule" locale = "en"
rightHeaderTemplate = "prev, next" leftHeaderTemplate = "today" centerTemplate = "month"
id = "events"
tooltip = "true">
<p:ajax event="dateSelect" listener="#{bean.onDateSelect}" update="eventsNew" oncomplete="eventDialog.show();"/>
<p:ajax event="eventSelect" listener="#{bean.onEventSelect}" update="eventsNew" oncomplete="eventDialog.show()"/>
</ p: schedule>

In my Bean have methods that make the selection of date and event. Have I configured the option of setEditable to true. Ajax function, jquery or javascript to show the popup containing only observation and event date. And looked at the documentation of primefaces and not found any implementation to solve my problem.

View Replies View Related

Java Code Using Timer Class To Schedule The Task

Feb 27, 2014

I have written the java code using timer class to schedule the task , but i am getting error as } expected, i am not able to figure out the error, I have placed the { opening and closing curly bracket everywhere but still it is giving me error.

mport java.io.*;
import java.io.FileInputStream;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import javax.mail.internet.MimeMessage.*;
import javax.mail.internet.InternetAddress.*;

[Code] ....

View Replies View Related

Schedule More Tasks Side By Side

Aug 16, 2014

I'm using SchedulerExecutorServices to Schedule a task. My Question is how can i schedule more than one task side by side:

Here is what I'm doing:

public class Scheduler {
public Scheduler(Runnable thread, int startAfter, int iterateAfter, TimeUnit timeUnit, int length) {
ScheduledExecutorService scheduler = Executors
.newSingleThreadScheduledExecutor();
final ScheduledFuture<?> timeHandle = scheduler.scheduleAtFixedRate(

[Code] ....

View Replies View Related

How To Compare Two JTable And Set Value From One JTable To Other One

May 26, 2014

I need to compare two jtable and set the value from one jtabel to the other jtable.

jtable one consist of:

Unit ID Unit Name Access

ABC, Inc ABC Incorporate (checkbox) value = uncheck

CDE, Inc CDE Incorporate (Checkbox) value = uncheck

jtable two consist of:

Unit ID Access

ABC, Inc ABC Incorporate (checkbox) value = checked
CDE, Inc CDE Incorporate (Checkbox) value = checked

if comparing jtable one an jtable two has the same Unit ID then colum Access from jtable two value is set to jtable one become check based on jtable two.I did the code but did not work:

for (i = 0, jTable1.getrowcount(), i++) {
for (j = 0, jTable1.getrowcount(), j++) {
if (jTable1.getvalueAt(i,0) == jTable2.getvalueat(j,0)) {
jTable1.setvalueat(true,i,2)
}
}
}

above code i try did not make any changes.

View Replies View Related

Tip Calculator For Fun

Oct 18, 2014

So, I'm working on a Tip Calculator for fun. I have everything worked out for the most part. The feature I am trying to add is to give the user the amount of change they'll get back from their transaction. I do not ask the user any information other than what is their bill.

Please enter your bill total : 5.50
Please enter your name : some name
Total : 5.50
Tax : 0.48 -- Based off a tax rate of 8.75%
Total with Tax : 5.98 --
20 percent Tip : 1.10
Total with Tax and 20 percent Tip : 7.08
Total change : <-- I believe this will be about $2.92

I want the total bill to round to the nearest $10 value (e.g. for $5.50, calculate bill to $10. For $13.00, calculate bill to the $20.00, and so on... This way I get an accurate amount of change to give back to the user.

View Replies View Related

MVC Calculator - How To Get It To Actually Calculate

Sep 28, 2014

I made a MVC calculator. I was wondering if you could take a look at my design and if I was on track. I am still working on getting it to actually calculate something. All the buttons respond and print text on the JTextField but it is not calculating.

package calculator.MVC;
import javax.swing.JButton;
import javax.swing.JTextField;
public class CalculatorModel {
private int sum;
private int number;
private char opt;

[code]....

View Replies View Related

Calculator Only Return 0.0?

Sep 2, 2014

I am making a calculator in Java. However, when I press the "=" button on my calculator, it always returns 0.0, no matter what. I don't understand why? The code is below:

import javax.swing.*;//import the packages needed for gui
import java.awt.*;
import java.awt.event.*;
import java.util.Arrays;
import java.util.List;
import static java.lang.Math.*;
public class CalculatorCopy {

[Code] ....

View Replies View Related

How To Add Loop In Calculator

Mar 11, 2015

import javax.swing.*;
public class BasicCalculator{
public static void main (String[] args) {
String output="";
double n1,n2;
String operation;
operation= JOptionPane.showInputDialog("Please enter your operation");

[Code] ....

How to add a loop in this problem:

View Replies View Related

While Loop Pay Calculator

Dec 2, 2014

I have the basic workings of this program just doing all the printing at the end is throwing me off. Anyway here are some of the requirements and my code:

1. Allow the user to input an individual's hours worked.
2. Accumulate the total regular hours worked, the overtime hours worked, the amount of the regular pay, the amount of overtime pay, and the total payroll, for all of the employees entered.
3. Allow the user to enter a zero (0) as the Boolean expression to end the loop.
4. When the loop ends print out all of the accumulated totals with appropriate labels, each on a separate line.

import java.util.Scanner;
public class WhileLoopPayCalc
{
public static void main(String [] args)
{
final double REGULAR_HOURS = 40f;
final double HOURLY_WAGE = 12.5f;
final double OVERTIME = 1.5f;

[code]....

View Replies View Related

Calculation In Awt Calculator

Jul 10, 2014

I am facing problem during calculation in my awt calculator. It is showing NumberFormatException. Below is part of code.

if(e.getSource()==b14)//On button 14, label is "/"
{
String v1=tf.getText().toString();
num1=num1+Integer.parseInt(v1);//num1 is as integer variable
tf.setText("");//tf means textField
}else

[code]....

View Replies View Related

Calculator In Java

Oct 28, 2014

I can not this to work correctly.

public static void main(String[] args) {
FloatWrapper x1=new FloatWrapper(0);
FloatWrapper x2=new FloatWrapper(0);
do{
switch(menu()){
case 'a': if(dataInput(x1,x2)) add(x1,x2); break;
case 'b': if(dataInput(x1,x2)) subtract(x1,x2); break;

[code]....

View Replies View Related

Trying To Create A Calculator

Sep 16, 2014

I'm new to java and have been coding for a few hours. I tried to create a calculator (Which has no GUI, just text inputs)which will let you select how to process the two integer (Add, minus, times etc.) I cant seem to get it to work. I will put in the process way such as times and have entered two integers and every time it doesn't work. Here is my code:

import java.util.*;
public class Calculator
{
public static void main (String args[])
{
int input1 = 0;
int input2 = 0;
int answer = 0;

[code]....

View Replies View Related

Create A Calculator With JCreator

May 24, 2010

I have got a problem when coding a java program to create a calculator with JCreator. How to write codes for decimal point.

Decimal point should not be set to the text more than 1 time until an operator is pressed. How can I use a Boolean value to solve this problem.

View Replies View Related

Calculator That Change Input Value Into Another Value

Nov 14, 2014

I am currently working on a small java programm. I use netbeans for it. And obviously I am new to java.

Basically its a calculator that change the input value into another value: like 10 € into whatever $ and same with Inch and Centimeters.

Therefore I need a second jDialog Form where i can change the factors for the calculator and start the calculator again.

Here is my problem: I can open the second Dialog but if I want to change the factor it doesn't change the value in the variable and the second calculator frame is with the old factors. It seems the double variable isn't working globally

I will add the files later when i find out how?

View Replies View Related

PostFix Calculator Project?

Apr 2, 2015

So I am working on a PostFix calculator that is used in command line for a class project, and I am having a little trouble on developing a memory for it. I have been told to create a hashMap and I have researched it and understand the basics of it. I have the calculating method working, but what I am having trouble trying to implement a way for the user to declare variables. For example this what the user should be able to do:

> a = 3 5 + 1 -
7
> bee = a 3 *
21
> a bee +
28

[code]....

I just need to be able to save the answers as a variable the User names, such as the example and let the user be able to use the variables later.

View Replies View Related

Random Number Calculator

Feb 1, 2015

the program basically has a random number generating, and I want to ask the user to try to guess the number, and keep guessing until the number is right. In addition to this, I need to put in extra conditions for too high or too low by 10. So for example, if they user guesses a number and its off by more than 10, then it prints that they guessed too high, and if its below 10 they guessed too low.

import java.util.*;
public class RandomNum
{
public static void main(String[] args)
{

Scanner scan = new Scanner(System.in);

[code].....

Modify the program to keep the user trying to guess the number till he/she gets it right, and stop once you guess the right number.Too high, high, too low, too low( If it's off by more than 10 = way too high, if its less than 10, way too low)

View Replies View Related

Basic Calculator Functions

Jul 2, 2014

my task is to add a few functions to an example calculator. I managed to add a divide button but I simply can't figure out how to add a working Pi and reciprocal function.

package newjavaproject;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class CalculateurNC extends Applet {

[code]....

View Replies View Related

How To Make Calculator Using Stacks

Feb 5, 2014

I got to make a java code for my class. I must make a calculator using stacks. I have a code but i got some mistakes. Here is the code

Java Code:

package stackscalc;
import java.util.Scanner;
import java.util.Stack;
import java.util.EmptyStackException;
class Arithmetic {
int length;
Stack stk;
String exp,

[Code] .....

View Replies View Related

Else Without If Error - Simple Calculator Using JOP

Oct 8, 2014

import javax.swing.JOptionPane;
public class Calculator {
public static void main ( String args[] ) {
double n1 = Double.parseDouble(JOptionPane.showInputDialog(" Enter first number: "));
double n2 = Double.parseDouble(JOptionPane.showInputDialog(" Enter second number: "));
String x = JOptionPane.showInputDialog("Enter operator: ");
double result;

[code].....

Write a program that mimics a calculator. The program will need to accept as input two numeric double values, and accept the operation to be performed as the third input. The operation to be performed will be input in the form of the character representing the java operator for the operation to be performed (i.e + for addition, - for subtraction, * for multiplication, / for division, or % for modulus). Once the program has read these 3 inputs it should output the numbers, the operator, and the result. (For division, if the denominator is zero, the program will output an appropriate message (i.e division by zero is an invalid operation). Please use the JOptionPane class for both accepting the required inputs and for the required output demonstrated below.Some sample output may look as follows:

3 + 4 = 7
13 * 5 = 65
10 / 3 = 3.33333333

Error Messages:
3 errors found:
File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 23]
Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:23: 'else' without 'if'
File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 31]
Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:31: 'else' without 'if'
File: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java [line: 37]
Error: /Users/gcaruso/Documents/CISS 110/Module 3/Module 4/Calculator.java:37: 'else' without 'if

View Replies View Related

Make A Calculator Using Java GUI

Jul 29, 2014

I am trying to make a calculator using Java GUI. I've managed to make an ActionListener and add it to a button, but I've made an error in my code that I'm unsure of how to solve. Because of how I've written the code, only one number can be placed in the text field. For example, the an ActionListener for the three button on the calculator was added to the button, but no matter how many times the user presses the button, only one 3 will appear in the text field. The code is below:

import javax.swing.*;//import the packages needed for gui
import java.awt.*;
import java.awt.event.*;
public class Calculator {
public static void main(String[] args) {
JFrame window = new JFrame("Window");//makes a JFrame
window.setSize(300,350);

[code].....

As you can see, because the compiler forces the String variable to be final, so when the user presses the button, the code simply shows how a space character and three character would look like, because the String variable can't change. How do I write my code so that every time the user presses the button, a character is added to the text field?

View Replies View Related

Basic Cost Calculator

Oct 20, 2014

Why I am getting errors for this program I (tried) to write. I am new to java.

import java.util.Scanner;
public class TheBarkingLot {
public static void main(String args[]) {
int n;
Scanner input = new Scanner(System.in);
System.out.println("How many large dogs are boarding today?");

[Code] ....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved