Running LV VI / program from python
Hi,
I have an automation SW written in python and I would like to get my LV measuring capabilities in to that
meaning calling the LV program and get the measured results back to my PY scripts
in LV i use the DAQMX to measure
if someone can help me with a small start programmer that would be helpful
using NI 6289 DAQ MX to measure differential voltage
thanks
Assaf
You could build your LabVIEW VI into a DLL and easily call that from Python using ctypes.
Attached is a very simple project with two VIs - AddNumbers.vi and SubtractNumbers.vi. You need to create a build specification for a DLL that includes these.
Right Click Build Specifications and select New/Shared Library (DLL)
Change the Target filename to LabVIEWMath.dll (or you have to edit the Python file that I included)
Change the Destination directory to the directory that contains the attached example project (not good practice but convenient here)
Select Source Files
Move AddNumbers.vi to the Exported VIs by highlighting them and clicking the blue arrow
Keep the defaults on Define VI Prototype (make sure you have C Calling Conventions selected)
Repeat the previous two steps for SubtractNumbers.vi
Click Build
Now from a command prompt, change to the LabVIEW example project directory and run the attached script 'Call LabVIEW.py'
=====================
LabVIEW 2012
Attachments:
Calling LabVIEW From Python - LV 82.zip 8 KB
Similar Messages
-
How to run a Concurrent Program from the back end?
Hi,
How to run a Concurrent Program from the back end?
Is it Possible to see that Concuurent Request id which we run from the back end, in the front end?
If yes, then Please Give reply how to write the code
Thanks in Advance,
Bharathi.SThis is documented in Chapter 20 of the Application Developers Guide http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121devg.pdf. These MOS Docs also have some information available
221542.1 - Sample Code for FND_SUBMIT and FND_REQUEST API's
235359.1 - How to Launch Planning Data Pull MSCPDP using FND_REQUEST.SUBMIT_REQUEST
HTH
Srini -
How can I run an external program from a PLSQL procedure?
Is there a package to run an external program from PLSQL? or is there another way to do that?
thanks.here there is an example about how a PL/SQL procedure can
work with an external C program.
http://download-east.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/dbms_pi2.htm#1003384
Apart from that you have Java Stored Procedures option
to carry out your task.
Java Stored Procedures Developer's Guide Contents / Search / Index / PDF
http://download-east.oracle.com/docs/cd/B10501_01/java.920/a96659.pdf
Joel P�rez -
URGENT: How to run a Java program from a different directory?
Hi.
How do I run a Java program from a directory that the file is not located in? So lets say im in c:\Java. But the file is in c:\Java\abc\efg\.
What would be the command to run the Java file from c:\Java.
I can't remember it and I need it asap.
Cheers.If the class you are trying to run is MyApp.class, try
c:\Java\>java -cp abc\efg MyAppThe actual classpath you specify will depend on whether or not MyApp.class is in a package (I've assumed it isn't) and whether or not any 3rd party jars are involbed (I've assumed not).
Edited by: pbrockway2 on Apr 1, 2008 6:42 PM
The command arguments read as "Run the MyApp class using as a classpath abc\efg relative to here (c:\Java)". -
Running an External Program from Batch on Windows Server 2008R2 Failing
Hi,
I am trying to run an external program from a batch job and it is failing with this error message:
Ext. prog.: ERROR: Input redirection is not supported, exiting the process immediately.
Ext. prog.: External program terminated with exit code 1
The program I am trying to run is: timeout
This command works on the OS: timeout -t 30
I have setup the step to look like this:
Under External Program:
-Name: timeout
-Parameter: -t 30
I have also tried:
-Name: timeout -t -30
-Parameter:
I am running ECC 6.04 on top of Windows Server 2008R2 with SQL Server 2008R2.
When we were running in Server 2003 on ECC 6.0 I was able to use the Sleep program just fine in the same manner. I have found out that sleep is not available in server 2008. It was replaced with timeout.
After an update to EHP4 and moving to Windows Server 2008R2, Is there any pre-work that needs to be done on the SAP or Windows side before we can run external programs?
Thank you,
Neil> SAPService<SID> and <SID>ADM both have Administrator rights for the server.
> That means they should have full access.
No - this is no more true like that since Windows 2008, it's a bit more complex:
http://en.wikipedia.org/wiki/User_Account_Control
> Where would you setup the permission/policy to "interact with the desktop"?
Add the policy using group policy editor (gpedit.msc)
Markus -
Run Child Concurrent Program from Main Concurrent Program
Hi,
I'm trying to run Child Concurrent Program from the Main Concurrent Program as below, could you suggest me on below.
Database:10g
Main_Concurrent_Program
=================
1) Will update staging table XXID_PO_ITM with Batch_id = 1,2,3,4,5
This staging table has 1000 rows, so every 200 rows will be updated with one of the above batch_id
This logic is working.
Child_Concurrent_Program
================
2) Above Main Concurrent Program should call below Child_Concurrent_Program.
This Child_Concurrent_Program will have parameter batch_id (based on above batch_id)
So, this Child_Concurrent_Program should kick off with batch_id = 1
Simillarly, Child_Concurrent_Program should kick off with batch_id = 2
Child_Concurrent_Program should kick off with batch_id = 3
Child_Concurrent_Program should kick off with batch_id = 4
Child_Concurrent_Program should kick off with batch_id = 5
Could you give me some suggestions on this?
Thanks.Check with FND_SUBMIT for submitting a concurrent job using child dependecies. Keep in mind, that once you call the API ... it spawns it's own thread and and becomes an autonomous process. Control is no longer maintained within the calling package.
procedure submit_interface_data(p_schedule_date in date,p_mm_header_id in number,p_req_id out number)
is
v_user_id number;
v_application_id number;
v_responsibility_id number;
begin
select user_id
into v_user_id
from fnd_user
where user_name = 'USER123';
select application_id,
responsibility_id
into v_application_id,
v_responsibility_id
from fnd_responsibility_tl
where responsibility_name = 'General Warehouse';
fnd_global.apps_initialize(v_user_id,v_responsibility_id,v_application_id);
p_req_id := fnd_request.submit_request ( application => 'XYZ',
program => 'MOVE_CONC_SHORT_NAME',
description => null,
start_time => p_schedule_date,
sub_request => false,
argument1 => p_mm_header_id);
commit;
exception
when others
then
spl_log_pub.write_exception(transaction_id => null,
transaction_type => null,
error_message => '<some error message>' ||
'sqlcode: ' || sqlcode ||
'sqlerrm: ' || sqlerrm);
end submit_interface_data;Edited by: sreese on May 18, 2012 3:16 PM -
Problem running a concurrent program from Reports
Hi,
I've come across a problem while running a concurrent program from Reports. The report is executed OK and at the end, I call a concurrent program by firing fnd_request.submit_request. I catch then the req_id returned and it gives me 0. I tried to replace the concurrent program, which is a UNIX shell script, with just a simple script that echos "hello", but anyway, I get 0 as return value from fnd_request.submit_request.
The next step I tried to set apps_initialize with proper vUSER_ID, vRESP_ID and vRESP_APPL_ID, but did not get away with that. My last try was to hardcode vUSER_ID to a sysadmin user, in case this was rights-related issue but did not work as well.
Am now looking into a possibility of actually getting the error, why it failes. I found some posts where FND_MESSAGE.RETRIEVE and FND_MESSAGE are used but this apparently does not work under Reports (am using reports builder v. 9.2.0.4.0).
Any suggestions how to solve this issue?
Thanks,
David Lacina.Hi,
Make sure that the concurrent program you are calling exists (case sensitive) and is enabled.
Create a PL/SQL package and use that to call your request - the you'll be able to use fnd_message.
Regards,
Gareth
Blog: http://garethroberts.blogspot.com/ -
Running a java program from an icon
I want to run my program from an icon on my desktop. I have a .bat file that I've built a shortcut to and it works.MY GUI program does display and run when I click on the icon. The problem is that the DOS window also shows up behind my GUI.
Is there anyway to prevent the DOS window from showing? Or is there another way to run a Java program without resorting to a DOS command line or running it through FORTE or another IDD?Chris's solution worked well, with one small problem. Once my GUI starts, it takes up the whole screen. Normally when I run it, it appears as a small window.
not a big problem, I can reduce it easily after it starts. But does anyone know a way to make it come up in the reduced size it norally comes up in when I run it from my IDE? -
Running a java program from a .asp page
i'm looking for someone in the community that knows how to run a java program
on a web server ( not an applet) from a asp page. The server as IIS 5 and the jre1.3.1
any help or tips would be welcomedThe following site explains in detail how you have to do it. I have done it and it works fine.
If u still have problems, contact me at [email protected]
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q167941 -
Running a ProC program from Apps
Dear all ,
We have developed custom Pro C Program. It's a huge scheduling program which does somany calculations and prints the log in the Concurrent Program Log using Printf statement.
Whenever we run this program from the Backend using telnet login command prompt , it finishes very quickly.
But the sametime ,if i run the program from Oracle Applications front end using a Concurrent Program, it takes a lot of time to complete.
Can anyonw let me know, Why there such a difference between running from backend and Front end?
Is it anything to do with some memory setting or Log file writing.
Thanks in advance.
jaganHi Jagan,
Your question seems to be related to Oracle Appliations. I suggest that you post your question in the Applications Technology Forum at this link :-
http://forums.oracle.com/forums/category.jspa?categoryID=11
Regards,
Sandeep -
Can we run external mail program from JSP / Servlet deployed on tomcat
Hi folks,
Had a tough time getting JavaMail API to work, finally when things seem to be working
there were some issues with the vendor's server, so finally gave up the idea.
On the server Apache and Tomcat are integrated via mod_jk and currently I redirect to a php page
which acts as a helper to send mail, however for the given business needs and server's limitations
there are potential security holes.
So I was wondering if I could directly execute the linux sendmail program from JSP/Servlet
as we would in a standalone java program or do we need special settings on Tomcat to execute external
programs.
Please let me know your views / ideas / comments on this
Thanks in advance
AbishekHi
It's not designed for you to be able to do this, it needs to run through 10gAS or 11gWeblogic.
Tony -
How to run a concurrent program from Menu List
Hi Guys,
I am working in HRMS. And did the following steps.
1. Created one concurrent program "Payroll Variance Report" as per customer's requirement.
2. Now user wants me to luanch this consurrent program from the People Form i.e. Reponsibility->People Form (on the same form, on the top of it 'Tools' bar is there where I need to attach one prompt "Pyaroll Variance Report" to its list). The moment user clicks on this "Payroll Variance Report" option of 'Tools' list, it should launch the concurrent request. I hope I make you understand my requirements. This is very urgent. Kindly give me you suggestions.
Looking forward to your replies.
Thanks
SunilUse FND_REQUEST.SUBMIT_REQUEST API.
Search the forum, My Oracle Support, eTRM, and the Developer guide for details about using this API.
Thanks,
Hussein -
Launching programs from python and ncurses
I've made a little menu launcher with python and ncurses. It works most of the time, but occationally it does nothing when I select a program to launch.
This is how it works:
1. A keyboard shortcut launches an xterm window that runs the program.
2. I select some program, which is launched via this command:
os.system("nohup " + "program_name" + "> /dev/null &")
3. ncurses cleans up and python calls "sys.exit()"
The whole idea with nohup is that the xterm window will close after I select an application, but the application will still start normally (this was a bit of a problem). This works most of the time, but sometimes nothing happens (it never works the first time I try launching a program after starting the computer, the other times are more random).
So, has anyone got an idea of what's going on or a better solution than the nohup hack?
The whole code for the menu launcher is below. It's quite hackish, but then again it was just meant for me. The file's called "curmenu.py", and I launch it with an xbindkeys shortcut that runs "xterm -e curmenu.py".
#!/usr/bin/env python
import os,sys
import curses
## Variables one might like to configure
programs = ["Sonata", "sonata", "Ncmpc", "xterm -e ncmpc", "Emacs", "emacs", "Firefox", "swiftfox",\
"Pidgin", "pidgin", "Screen", "xterm -e screen", "Thunar", "thunar", \
"Gimp", "gimp", "Vlc", "vlc", "Skype", "skype"]
highlight = 3
on_screen = 7
## Functions
# Gets a list of strings, figures out the middle one
# and highlights it. Draws strings on screen.
def drawStrings(strings):
length = len(strings)
middle = (length - 1)/2
for num in range(length):
addString(strings[num], middle, num, length)
stdscr.refresh()
def addString(string, middle, iter_step, iter_max):
if iter_step < iter_max:
string = string + "\n"
if iter_step == middle:
stdscr.addstr(iter_step + 1, 1, string, curses.A_REVERSE)
else:
stdscr.addstr(iter_step + 1, 1, string)
# Returns a list of strings to draw on screen. The
# strings chosen are centered around position.
def listStrings(strings, position, on_screen):
length = len(strings)
low = (on_screen - 1)/2
start = position - low
str = []
for num in range(start, start + on_screen):
str = str + [strings[num % length]]
return str
## Start doing stuff
names = programs[::2]
longest = max(map(lambda x: len(x), names))
# Start our screen
stdscr=curses.initscr()
# Enable noecho and keyboard input
curses.curs_set(0)
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
# Display strings
drawStrings(listStrings(names, highlight, on_screen))
# Wait for response
num_progs = len(names)
low = (on_screen - 1)/2
while 1:
c = stdscr.getch()
if c == ord("q") or c == 27: # 27 = "Escape"
break
elif c == curses.KEY_DOWN:
highlight = (highlight + 1)%num_progs
elif c == curses.KEY_UP:
highlight = (highlight - 1)%num_progs
elif c == curses.KEY_NPAGE:
highlight = (highlight + low)%num_progs
elif c == curses.KEY_PPAGE:
highlight = (highlight - low)%num_progs
elif c == 10: # actually "Enter", but hey
os.system("nohup " + programs[2*highlight + 1] + "> /dev/null &")
break
drawStrings(listStrings(names, highlight, on_screen))
# Close the program
curses.nocbreak()
stdscr.keypad(0)
curses.echo()
curses.endwin()
sys.exit()Try:
http://docs.python.org/lib/module-subprocess.html
Should let you fork programs off into the background. -
Not able to run the Java Program from jre for the ARM processor
Hi ,
I am try to run the jre1.4.2 for the arm core (linux 2.6kernel) which i downloaded from the sun site.
I am created the class file from the J2SE1.4 development kit. I created the simple HelloWorld Program and complied with J2Se then i copied that class file into my IMX board which has ARM core.
When i run the commnd java HelloWorld i am getting this error
dl failure on line 765Error: failed /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjve
Please give me some suggestion to solve this porblem
Thanks in Advance
NarendraI JRE i have download from the sun site . But when i am trying to run the simple helloWorld program in that it is giving the below error.
error:
dl failure on line 765Error: failed /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjvm.so because /dev/shm/jvm/j2re1.4.2/lib/arm/client/libjvm.so: symbol __divdf3, version GCC_3.0 not defined in file libgcc_s.so.1 with link time reference.
Can anybody help me in this how to solve this problem . I also searched in the forum but did not get any answer on that problem
Thanks in advance.
Narendra -
Error when running mortgage calc program from DOS prompt
I have a GUI Mortgage Calculator program. It probably isn't the most efficient use of code, but it gets the job done. I am running java SDK 1.6.0_06. This is a class assignment. We are to compile the code and post the .class file for our team members to run. I am trying to get the .class file to run after I compile it with javac. I used jCreator LE to create it... it compiles and runs there just fine. The program will compile at the DOS prompt, but will not run properly. The following is the error I get (any help would be appreciated):
Exception in thread "mani" java.lang.NoClassDefFoundError: manchorMortgage3
Caused by: java.lang.ClassNotFoundException: manchorMortgage3
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader1.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Below is my code:
* manchorMortgage3.java
* Created on July 10, 2008
* This program calculates and displays the mortgage amount
* from user input of the amount of the mortgage and the user's
* selection from a menu of available mortgage loans.
import java.math.*; //*loan calculator
import java.text.*; //*formats numbers
import java.util.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class manchorMortgage3 extends javax.swing.JFrame {
/** Creates new form manchorMortgage3 */
public manchorMortgage3() {
initComponents();
setLocation(300,200);
/** This method is called from within the constructor to
* initialize the form.
// Begin Initialize Components
private void initComponents() {
mortgageAmount = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
termAndInterest = new javax.swing.JLabel();
jRadioButton1 = new javax.swing.JRadioButton();
jRadioButton2 = new javax.swing.JRadioButton();
jRadioButton3 = new javax.swing.JRadioButton();
calcButton = new javax.swing.JButton();
enterAmount = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Manchor - Mortgage Calculator - Week 3");
mortgageAmount.setText("Enter the Mortgage Amount:");
termAndInterest.setText("Select Your Term and Interest Rate:");
jRadioButton1.setText("7 years at 5.35%");
jRadioButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton1.setMargin(new java.awt.Insets(0, 0, 0, 0));
jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRadioButton1ActionPerformed(evt);
jRadioButton2.setText("15 years at 5.5%");
jRadioButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton2.setMargin(new java.awt.Insets(0, 0, 0, 0));
jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRadioButton2ActionPerformed(evt);
jRadioButton3.setText("30 years at 5.75%");
jRadioButton3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jRadioButton3.setMargin(new java.awt.Insets(0, 0, 0, 0));
jRadioButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jRadioButton3ActionPerformed(evt);
calcButton.setText("Calculate");
calcButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
calcButtonActionPerformed(evt);
jTextArea1.setColumns(20);
jTextArea1.setEditable(false);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jButton2.setText("Quit");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(enterAmount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 222, Short.MAX_VALUE)
.addComponent(calcButton)
.addGap(75, 75, 75))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jRadioButton3)
.addComponent(jRadioButton2)
.addComponent(jRadioButton1)
.addComponent(termAndInterest)
.addComponent(mortgageAmount)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(224, Short.MAX_VALUE)))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(277, Short.MAX_VALUE)
.addComponent(jButton2)
.addGap(70, 70, 70))
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(mortgageAmount)
.addGap(14, 14, 14)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(20, 20, 20)
.addComponent(termAndInterest)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jRadioButton1)
.addGap(15, 15, 15)
.addComponent(jRadioButton2)
.addGap(19, 19, 19)
.addComponent(jRadioButton3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(calcButton)
.addComponent(enterAmount))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(jButton2)
.addGap(20, 20, 20))
pack();
}// End initialize components
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//event_jButton2ActionPerformed
System.exit(1);
}//event_jButton2ActionPerformed
static NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US);
static NumberFormat np = NumberFormat.getPercentInstance();
static NumberFormat ni = NumberFormat.getIntegerInstance();
static BufferedReader br;
private void calcButtonActionPerformed(java.awt.event.ActionEvent evt) {//event_calcButtonActionPerformed
enterAmount.setText(null);
jTextArea1.setText(null);
double monthlyPayment;
double interest;
double amount ;
int years ;
double monthlyInterest, monthlyPrinciple, principleBalance;
int paymentsRemaining, lineCount;
np.setMinimumFractionDigits(2);
br = new BufferedReader(new InputStreamReader(System.in));
lineCount = 0;
try
amount=Double.parseDouble(jTextField1.getText());
catch (Exception e)
enterAmount.setText("Please Enter Mortgage Amount");
return;
if(jRadioButton1.isSelected())
interest=0.0535;
years=7;
else if(jRadioButton2.isSelected())
interest=0.055;
years=15;
else if(jRadioButton3.isSelected())
interest=0.0575;
years=30;
else
enterAmount.setText("Please Select Your Term and Interest Rate");
return;
jTextArea1.append(" For a mortgage of " + nf.format(amount)+"\n"+" With a Term of " + ni.format(years) + " years"+"\n"+" And an Interest rate of " + np.format(interest)+"\n"+" The Payment Amount is " + nf.format(getMortgagePmt(amount, years, interest)) + " per month."+"\n"+"\n");
principleBalance = amount - ((getMortgagePmt(amount, years, interest)) - (amount*(interest/12)));
paymentsRemaining = 0;
do
monthlyInterest = principleBalance * (interest/12);//*Current monthly interest
monthlyPrinciple = (getMortgagePmt(amount, years, interest)) - monthlyInterest;//*Principal payment each month minus interest
paymentsRemaining = paymentsRemaining + 1;
principleBalance = principleBalance - monthlyPrinciple;//*New balance of loan
jTextArea1.append(" Principal on payment " + ni.format(paymentsRemaining) + " is " + nf.format(monthlyPrinciple)+"\n");
jTextArea1.append(" Interest on payment " + ni.format(paymentsRemaining) + " is " + nf.format(monthlyInterest)+"\n");
jTextArea1.append(" New loan balance on payment " + ni.format(paymentsRemaining) + " is " + nf.format(principleBalance)+"\n"+"\n"+"\n");
while (principleBalance > 1);
}//Begin event_jRadioBtton1Action Performed
public static double getMortgagePmt(double balance, double term, double rate)
double monthlyRate = rate / 12;
double monthlyPayment = (balance * monthlyRate)/(1-Math.pow(1+monthlyRate, - term * 12));
return monthlyPayment;
private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt) {//Begin event_jRadioButton3ActionPerformed
if(jRadioButton2.isSelected())
jRadioButton2.setSelected(false);
if(jRadioButton1.isSelected())
jRadioButton1.setSelected(false);
}//End event_jRadioButton3ActionPerformed
private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//Begin event_jRadioButton2ActionPerformed
if(jRadioButton1.isSelected())
jRadioButton1.setSelected(false);
if(jRadioButton3.isSelected())
jRadioButton3.setSelected(false);
}//End event_jRadioButton2ActionPerformed
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
if(jRadioButton2.isSelected())
jRadioButton2.setSelected(false);
if(jRadioButton3.isSelected())
jRadioButton3.setSelected(false);
}//End event_jRadioButton1ActionPerformed
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new manchorMortgage3().setVisible(true);
// Begin variables declaration
private javax.swing.JButton calcButton;
private javax.swing.JButton jButton2;
private javax.swing.JLabel mortgageAmount;
private javax.swing.JLabel termAndInterest;
private javax.swing.JLabel enterAmount;
private javax.swing.JRadioButton jRadioButton1;
private javax.swing.JRadioButton jRadioButton2;
private javax.swing.JRadioButton jRadioButton3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
// End variables declaration
}The class is not in your classpath. Likely you blew away your classpath with some silly environment variable.
If you are in the directory where your class file is then execute
java -cp . manchorMortgage3and it will work. (Note the -cp . which tells java to include the current directory in the runtime classpath)
Maybe you are looking for
-
Successfully Intalled Oracle 11i E-Business Suite in windows platform !
Dear All After struggling almost 15 days (documents searching from google, metalink etc...), successfully intalled more than 6 times in Window 2000, windows 2003, and Windows XP . Anyone wants to know the steps contact me directly, i will advice you
-
Easy DMS cannot use additional data while creating a document
Hello, We have installed sap easy dms 7.0 We have a problem while creating a new document with SAP Easy DMS. On the DIR tab the additional data cannot be used. Do I have to change a registry setting? We already have defined classes and their features
-
Get_context_change_log retrieves no changes although turned on
Dear all, Thank you for looking into this issue. We have a complex WD ABAP application with many views, embedded views, etc. In most of the views embedded in the main view we're calling in the wddoinit the context method enable_context_change_log to
-
I'm asked for my registered phone # and PIN
Why am I asked to enter my registered phone # and PIN? When you call your Skype To Go numbers, you are identified by your registered phone’s caller ID and won’t need to enter your registered phone number and PIN for authentication purposes. There are
-
Downloading info from another network computer
I have the 8703 Blackberry, but the original desktop software was lost over the last 2 years. I have since downloaded 4.7 and I am not able to download info from my partners' Outlook via the network. Previously there was the opportunity to download