Help need to put in app to different ipod
hi i downloaded the call of duty game for my friend as a surprise birthday present but it said for me to put on the game it has to sync all the other apps out or something anyway i can bypass this i dont want to delete all of his apps to put in the game i bought
Too bad you DL'd it using your ituens store account.
The only way to give it now, is to put it on his PC and authorize his PC for your itunes store account.
By that I mean, copy the call of duty IPA file over to his PC using a USB stick. Or get on his PC and download it again for free after you have signed into the itunes store with your account.
Similar Messages
-
I have the new iPad . I don't know how my sister's apple ID was set. I have all under my iTunes account but when i need to update my apps, a different apple ID come up! how do i change that?
Hi maggieanntb, your sister's Apple ID came up because an app(s) was downloaded using her account. To prevent that from happening, you would have to delete the app(s) that were downloaded on her's, and re-download them using your own Apple ID.
-
please help, my grandson put a passcode in the ipod and now can't remember. we have tried restoring but that still doesn't work. forgotten passcode and device is disabled for trying too many times
Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
1. iOS- Forgotten passcode or device disabled after entering wrong passcode
2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
3. Restoring iPod touch after forgotten passcode
4. What to Do If You've Forgotten Your iPhone's Passcode
5. iOS- Understanding passcodes
6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
Forgotten Restrictions Passcode Help
You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
Also, see iTunes- Restoring iOS software. -
Where can I find the registration number of my product? I need to put it on a different computer.
If you registered the product with Adobe the number should be in your account.
You will need to come here via your web browser
https://forums.adobe.com/thread/1595271
Then click on the red Adobe logo (top let on the page) and choose manage account. You should then be able to browse your purchase history and registered products. -
As a grand parent, how can I put some apps on an ipod touch and then give it as a gift?
As a grand parent, how can I put some apps on an ipod touch and then give it as a gift?
Apps and many other purchases are tied to the iTunes Store account via which they were purchased. So if you buy the app, that app is tied to your iTunes Store account. Without that account information, the child could not update the app nor back it up.
I'd also suggest giving the child an iTunes gift card or gift certificate along with the iPod. If the child is too young to have and manage his or her own iTunes Store account, then his or her parent could set up an iTunes Store account to purchase the apps. That could be done with that gift card and not need a credit card. You can also gift specific apps, though again that would require the child or a parent to open an iTunes Store account through which to redeem the gift. For more information on gift options, see:
http://support.apple.com/kb/HT2736
Regards.
Message was edited by: Dave Sawyer -
I have an itunes account. However, I need to copy music onto a different iPod than my own. How do I do that? Do I need to create a separate iTunes account for that iPod?
An account means an iTunes Store account which is an online service. Do you mean that, or do you mean a library on a computer?
iOS devices can only be synced to one iTunes library at a time. You can sync that iPod to your account but it will wipe everything currently on it.
iTunes: Syncing media content to iOS devices and iPod - http://support.apple.com/en-us/HT201253 - detailed example: https://discussions.apple.com/message/18860187#18860187
If you use manual syncing, you can sync items from more than one iTunes library to your iPod. (You can sync iPod touch, iPhone, and iPad with only one iTunes library.) When manually managing content, you can add content from multiple libraries to your iPod or iPad. Even when manually managing music, some content may be available from only one library at time. This includes all content on iPhone and video content on iPod and iPad. http://support.apple.com/kb/PH12113 and http://support.apple.com/kb/HT1202
I could post another 2 pages of stuff trying to cover every possible scenario. It would help if you let us know exactly what you want to do. Are you trying to sync just a few songs (like giving them to a friend which is something iTunes is deliberately set up not to do)? -
HT201209 Help needed to Redeem an app
Hi, I'm brand new to Apple iPad. I was given three iPad cards worth $10.00 each. Someone helped me redeem a couple apps but I cannot remember how to do it. I'm showing $17.04 credit under my Apple ID. When I select the app that I want,"in this case Numbers", I scroll to the bottom of (Featured) and click Redeem, I'm prompted to enter the code.
I know I'm doing something stupid. I clicked buy on a couple apps and it was charged to my credit card. I can't afford that especially when this is work related. Can you please help me with this?
Thank You,
Mike Morris
<Personal Information Edited by Host>You only use the "Redeem" if you've been given the gift of that specific app and have a code to redeem. If you wish to buy an app using your credit balance, going through the normal "buy" process usually works. Assuming you were not buying a gift for someone else - gifts cannot be purchased using a credit balance - another user in the forums posted the information I quote below as the reply from the iTunes Store when this issue was brought up. Perhaps it will help you. If problems persist, contact the iTunes Store:
http://www.apple.com/emea/support/itunes/contact.html
Regards.
I'm sorry you weren't able to make a purchase using your store credit. To purchase items on the iTunes Store with your store credit, your account information in your user profile needs to be corrected. I'll walk you through this process to get you back up and running in no time.
1) Visit the My Apple ID website at: http://appleid.apple.com
2) If the site is not displayed in your preferred language, click the Change Language link in the upper-right corner, type the name of your language in the field that appears, then click the Save button.
3) Click the "Manage your account" link.
4) Type your iTunes Store account name (which is your Apple ID) in the Apple ID field, type your password in the password field, then click the Sign In button.
5) Click "Addresses" in the column on the left. If you have multiple shipping addresses, remove any out-of-date or duplicate addresses by clicking Delete. Also, make sure the state or province field is filled out correctly for each address. To edit an address, click Edit. Edit all of your shipping addresses and make sure the appropriate state is selected in the State drop-down menus.
6) Now click "Phone Numbers" on the left. The area codes should be in the area code fields and the phone numbers should be in the phone number fields. If an area code is missing, or if it is in a phone number field, your account information may not save properly.
7) Make any other necessary corrections, then click the Save Changes button.
8) Click Log out in the upper-right corner. When you make your next purchase on the iTunes Store, you will be asked to review your billing information. At this point, you can change your information or simply click Done at the bottom of the screen to proceed. Once you click Done, you should be able to purchase on the iTunes Store using your store credit. -
Help needed abou SNAPit SEEit app
Dear all
I have Lenovo s 580,I need to install SNAPit app for camera as the stock can app sucks, so any help pleaseHi Moustafa
Did you contact Lenovo dedicated support as I previously recommended?
Regards.
Did someone help you today? Press the star on the left to thank them with a Kudo!
If you find a post helpful and it answers your question, please mark it as ''ACCEPT AS SOLUTION"!
Unsolicited PM's will not be answered! ....Please post your question/s in the appropriate forum board.
English Community Deutsche Community Comunidad en Español Русскоязычное Сообщество -
How to put old apps on my ipod touch?
I am so irritated!
I kept getting the same error message when trying to download apps, that I needed to upgrade my operating system.
I just want to get Netflix, Hulu, and Google Chrome on my ipod touch.
I previously had Netflix and Google, before I restored it.
There was no message that said I would not be able to put the apps that were previously working, back on my ipod touch.
An IT person at Netflix said I should look on my computer to see if some of the memory on my ipod got saved on the computer.
How can I do this?
How do I make my expensive Apple product, that is not that old, work?
Even though Apple is going to lose it's customers as they all begin to run into this problem. Stupid Apple. I will never by another one again!!!
Sorry if this is not greatly explained. I am not a horribly tech savvy person. Mine is an "MC" model.As I said, please tell us what you can buy in electronics where you will not run into the same problem?
If you do go the Android route (Android and upgrade do not go well together at all) be sure that you buy an external drive and BACKUP YOUR DATA, MUSIC, VIDEO, and ALL OF YOUR APPS. You will eventually run into the same problem and you want to make sure you have access to older versions of the app. The Android world is more wide open and you may be able to find older versions somewhere on the net and be able to download it but because that world is wide open you then take a risk of putting malware on your device. -
HT4082 Way to put Ipad apps on Iphone/Ipod
Hello everybody: Does anyone know a way that works to put Ipad apps on Ipod 3? I desperetly want to play chocabo panic It's the only game that I serusly want that won't work on my Ipod. I have know one to play with anyway. Any help would be apreated.
Sorry jenmoon, but that app appears to only be made to work on the iPad. Many apps (as you probably already know) have been designed by the developers to work on all iOS devices. Apparently this one has not.
Here is a link to the developer's site. Perhaps you can provide feedback to them via this site:
http://support.na.square-enix.com/
Best of luck,
GB -
Can I put purchased apps on both ipod touch and iphone4
I have an ipod touch and am going to purchase an iphone. Can I put purchased apps on both? If so how do I do it? I hate to have to double buy all these apps. The free ones I can download again.
Yes you can unless an app is specifically for the Touch. There are two ways to do when you get your new iPhone:
- When you first connect your iPhone you should be asked if you want to restore the phone using the backup of your Touch. I got that option when I already had a iPad and then bout a 4G Touch. The backup will get you all the applicable app together with there data.
- Do not restore from backup and instead check in iTunes the apps you want on the iPhone. However, only the apps themselves will be on the iPhone not any data in the apps that were on the Touch. -
Yesterday, I purchased Mobicip Safe browser application. I downloaded it to my Imac at work.
I synced it with my sons Ipod... which messed it up since his Ipod was synced from our home computer.
He deleted the app when he reinstalled everything I deleted from our home computer this morning.
So, how do I get the Mobicip app back on his ipod without recking his directory? Do I have to buy it again from my home computer? Is there a way to install just the browser and leave everything else the same?
thanksJust copy it from your computer to some sort of removable medium, such as a flash drive, take it home to your home computer, and drag the app into the iTunes window (in his computer user account, if he has his own). Authorize the computer to your iTunes Store account, if it's not already, and you can then sync the app to his iPod without deleting anything else. Or you can download the app again using the home computer, if that's easier.
Regards. -
Help needed with putting in a sub menu
Hi all
I'm trying to put in a 3 button sub menu into a 5 button menu
that is already in a template that I've purchased. The menu is
currently in the following format
HOME - ABOUT - SERVICES - PARTNERS - CONTACT
I wish to have the 3 services / products available listed
below as well as next and previous buttons to navigate between the
pages, but with my limited knowledge of scripting I'm a little more
than stumped. Any and all help will be gratefully appreciated.
I have uploaded the .fla file so if you can help and take a
look.
flash file
Regards
DaveWill field "B" ever have a value of zero?
Assuming fields "B" and "B" are formatted as "Number" and field "A" is formatted as "Percentage", then only only needs to check for field c for a value of zero.
One may also need to account for the fact that a null string ("') field will be treated as zero.
The custom calculation for field "D" could be:
// get field objects;
var oDivisor = this.getField("B"); // field object for divisor;
var oDividend = this.getField("C"); // field object for dividend;
event.value = ""; // default result if no computation performed;
if(oDivisor.value != 0 && oDividend.value != 0) {
event.value = oDividend.value / oDivisor.value; -
Help needed to put requirements into uml format
Hi
I have got into the bad habit of reading the specification and going
straight into coding without doing any analysis or design, but all thats about to change! i have been reading some uml tutorials, but none seem relevant to the project i have at the moment, could anyone tell me whether i need to do uml use cases etc for it as it seems quite basic.
all i am doing is sending rmi messages between applications using different scenarios, ie across a network, on the same network etc etc, then i just get the system start time and stop time after ive sent 1000 messages and thats my result. uml wise, i obviously need an actor for the enginner running the programme, cant think of any more actors unless im missing something? then i need a use case of the messages being sent. do i need one for each scenario? h
help would be gratefully received
nessIf Use Cases don't make a lot of sense to you, don't feel that you have to use them. There's no point generating meaningless documentation that neither you nor anybody else is ever going to read...
The main point of Use Cases (IMHO) is in requirements elicitation. The diagrams look nice and simple, so you can show them to the client, and make them feel smart.
Actors are entities that are external to the system or sub-system being modelled. So an Actor could be a user, another computer system, or an external event (e.g. a particular date and time). Actors initiate interactions, so anytime you have a particular function (Use Case) that is triggered by an event, you should ask yourself where the trigger comes from.
Don't forget to add extra textual information to Use Case diagrams. I include information such as:
Iteration
Summary
Course of events
Alternative paths
Exception paths
Extension points
Triggers
Assumptions
Preconditions
Postconditions
Any business rules
Author and Date for any modifications to the Use Case
Needless to say, this is a lot of information, almost none of which is conveyed by the diagram itself. You may be better off creating a simple list of functions and filling in the above information for each, or maybe the Use Case diagrams will help you think about what the functions and interactions actually are.
Good luck. -
Code troubleshooting help needed - buttons spawning 2 apps
Hi,
I'm trying to do a question out of my Java text book and I'm a little confused why its not working correctly. There's 2 buttons on a frame that when clicked start the app behind them... one is a basic calculator, the other is a little applet to compute a mortgage. The second button is not reacting like the first does AND the Mortgage applet behind that button does not start-up properly... the box opens but nothing in the frame is visible.
The first thing I need to be explained is that in the Mortgage section why I can't change it into an application from an applet without receiving an error. On my separate Mortgage applet (standalone) I switched it from applet to application by adding the following:
public static void main(String[] args) {
//create a frame
JFrame frame = new JFrame (
"Running a program as applet and frame");
//create an instance of MortgageApplet
MortgageApplet applet = new MortgageApplet();
//add the applet instance to the frame
frame.getContentPane().add(applet, BorderLayout.CENTER);
//invoke init and start
applet.init();
applet.start();
//display the frame
frame.setSize(300, 300);
frame.setVisible(true);
}But when I add that code to this exercise with the 2 buttons kicking the 2 sub apps off I get the following error...
Exercise12_17.java:130: cannot resolve symbol
symbol : method start ()
location: class MortgageApplet
applet.start();So because of that I have that section of the code commented out below.... I copied that straight from my book and[b] it works when its standalone but not within this bigger app I'll paste below.
The second thing I need explained is why does the second button not behave like the first button...
If you click the first button it starts the calculator and then shows a "hide calculator" button to hide the calculator application. And if you click that hide button you return to the original menu with the 2 buttons (Calc & Mortgage) to choose from. But if you click the Mortgage button it brings up the Mortgage app (which currently is not working correctly in here) BUT does not show me the "Hide Mortgage" button... it jumps to the "Simple Calculator" button.
My assumption is it has something to do with the If-Else if actionPerformed argument I have in the code below but I'm not entirely sure.
Does anyone have answers to me 2 questions??...
(1) do I need to change the mortgage applet to application & why am I getting that error when trying to do so? ...... and ......
(2) why does my 2nd button on the main menu not get the "hide mortgage" button after starting the mortgage app & how would I correct it? (I assume that if I solve problem #1 it'll spawn the app correctly in part 2 when it starts).
Any help would be greatly appreciated... thank you. :-)
Rob
-------------------------entire app below--------------------
// Exercise12_17.java: Create multiple windows - Simple Calc & MortgageApplet
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;
public class Exercise12_17 extends JFrame implements ActionListener {
// Declare and create a frame: an instance of MenuDemo
MenuDemo calcFrame = new MenuDemo();
// Declare and create a frame: an instance of MortgageApplet
MortgageApplet mortgageAppletFrame = new MortgageApplet();
// Declare two buttons for displaying frames
private JButton jbtCalc;
private JButton jbtMortgage;
public static void main(String[] args) {
Exercise12_17 frame = new Exercise12_17();
frame.pack();
frame.setTitle("Exercise 12.17: Multiple Windows Demo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
public Exercise12_17() {
// Add buttons to the main frame
getContentPane().setLayout(new FlowLayout());
getContentPane().add(jbtCalc = new JButton("Simple Calculator"));
getContentPane().add(jbtMortgage = new JButton("Mortgage"));
// Register the main frame as listener for the buttons
jbtCalc.addActionListener(this);
jbtMortgage.addActionListener(this);
public void actionPerformed(ActionEvent e) {
String arg = e.getActionCommand();
if (e.getSource() instanceof JButton)
if ("Simple Calculator".equals(arg)) {
//show the MenuDemo frame
jbtCalc.setText("Hide Simple Calculator");
calcFrame.pack();
calcFrame.setVisible(true);
else if ("Hide Simple Calculator".equals(arg)) {
calcFrame.setVisible(false);
jbtCalc.setText("Simple Calculator");
else if ("Mortgage".equals(arg)) {
//show the Mortgage frame
mortgageAppletFrame.pack();
jbtMortgage.setText("Hide Mortgage");
mortgageAppletFrame.setVisible(true);
else if ("Mortgage".equals(arg)) {
mortgageAppletFrame.setVisible(false);
jbtMortgage.setText("Mortgage");
class MortgageApplet extends JFrame implements ActionListener {
// Declare and create text fields for interest rate
// year, loan amount, monthly payment, and total payment
private JTextField jtfAnnualInterestRate = new JTextField();
private JTextField jtfNumOfYears = new JTextField();
private JTextField jtfLoanAmount = new JTextField();
private JTextField jtfMonthlyPayment = new JTextField();
private JTextField jtfTotalPayment = new JTextField();
// Declare and create a Compute Mortgage button
private JButton jbtComputeMortgage = new JButton("Compute Mortgage");
/** Initialize user interface */
public void init() {
// Set properties on the text fields
jtfMonthlyPayment.setEditable(false);
jtfTotalPayment.setEditable(false);
// Right align text fields
jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
// Panel p1 to hold labels and text fields
JPanel p1 = new JPanel();
p1.setLayout(new GridLayout(5, 2));
p1.add(new Label("Annual Interest Rate"));
p1.add(jtfAnnualInterestRate);
p1.add(new Label("Number of Years"));
p1.add(jtfNumOfYears);
p1.add(new Label("Loan Amount"));
p1.add(jtfLoanAmount);
p1.add(new Label("Monthly Payment"));
p1.add(jtfMonthlyPayment);
p1.add(new Label("Total Payment"));
p1.add(jtfTotalPayment);
p1.setBorder(new TitledBorder("Enter interest rate, year and loan amount"));
// Panel p2 to hold the button
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
p2.add(jbtComputeMortgage);
// Add the components to the applet
getContentPane().add(p1, BorderLayout.CENTER);
getContentPane().add(p2, BorderLayout.SOUTH);
// Register listener
jbtComputeMortgage.addActionListener(this);
//*********ADDED THIS SECTION below TO MAKE APPLET AN APPLICATION***********
// public static void main(String[] args) {
//create a frame
// JFrame frame = new JFrame (
// "Running a program as applet and frame");
//create an instance of MortgageApplet
// MortgageApplet applet = new MortgageApplet();
//add the applet instance to the frame
// frame.getContentPane().add(applet, BorderLayout.CENTER);
//invoke init and start
// applet.init();
// applet.start();
//display the frame
// frame.setSize(300, 300);
// frame.setVisible(true);
//*********ADDED THIS SECTION above TO MAKE APPLET AN APPLICATION***********
/** Handle the "Compute Mortgage" button */
public void actionPerformed(ActionEvent e) {
if (e.getSource() == jbtComputeMortgage) {
// Get values from text fields
double interest = (Double.valueOf(
jtfAnnualInterestRate.getText())).doubleValue();
int year =
(Integer.valueOf(jtfNumOfYears.getText())).intValue();
double loan =
(Double.valueOf(jtfLoanAmount.getText())).doubleValue();
// Create a mortgage object
Mortgage m = new Mortgage(interest, year, loan);
// Display monthly payment and total payment
jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
class MenuDemo extends JFrame implements ActionListener {
// Text fields for Number 1, Number 2, and Result
private JTextField jtfNum1, jtfNum2, jtfResult;
// Buttons "Add", "Subtract", "Multiply" and "Divide"
private JButton jbtAdd, jbtSub, jbtMul, jbtDiv;
// Menu items "Add", "Subtract", "Multiply","Divide" and "Close"
private JMenuItem jmiAdd, jmiSub, jmiMul, jmiDiv, jmiClose;
/** Main method */
public void main(String[] args) { //Change-was public static void main(String[] args)
MenuDemo frame = new MenuDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
/** Default constructor */
public MenuDemo() {
setTitle("Menu Demo");
// Create menu bar
JMenuBar jmb = new JMenuBar();
// Set menu bar to the frame
setJMenuBar(jmb);
// Add menu "Operation" to menu bar
JMenu operationMenu = new JMenu("Operation");
operationMenu.setMnemonic('O');
jmb.add(operationMenu);
// Add menu "Exit" in menu bar
JMenu exitMenu = new JMenu("Exit");
exitMenu.setMnemonic('E');
jmb.add(exitMenu);
// Add menu items with mnemonics to menu "Operation"
operationMenu.add(jmiAdd= new JMenuItem("Add", 'A'));
operationMenu.add(jmiSub = new JMenuItem("Subtract", 'S'));
operationMenu.add(jmiMul = new JMenuItem("Multiply", 'M'));
operationMenu.add(jmiDiv = new JMenuItem("Divide", 'D'));
exitMenu.add(jmiClose = new JMenuItem("Close", 'C'));
// Set keyboard accelerators
jmiAdd.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
jmiSub.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
jmiMul.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
jmiDiv.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK));
// Panel p1 to hold text fields and labels
JPanel p1 = new JPanel();
p1.setLayout(new FlowLayout());
p1.add(new JLabel("Number 1"));
p1.add(jtfNum1 = new JTextField(3));
p1.add(new JLabel("Number 2"));
p1.add(jtfNum2 = new JTextField(3));
p1.add(new JLabel("Result"));
p1.add(jtfResult = new JTextField(4));
jtfResult.setEditable(false);
// Panel p2 to hold buttons
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout());
p2.add(jbtAdd = new JButton("Add"));
p2.add(jbtSub = new JButton("Subtract"));
p2.add(jbtMul = new JButton("Multiply"));
p2.add(jbtDiv = new JButton("Divide"));
// Add panels to the frame
getContentPane().setLayout(new BorderLayout());
getContentPane().add(p1, BorderLayout.CENTER);
getContentPane().add(p2, BorderLayout.SOUTH);
// Register listeners
jbtAdd.addActionListener(this);
jbtSub.addActionListener(this);
jbtMul.addActionListener(this);
jbtDiv.addActionListener(this);
jmiAdd.addActionListener(this);
jmiSub.addActionListener(this);
jmiMul.addActionListener(this);
jmiDiv.addActionListener(this);
jmiClose.addActionListener(this);
/** Handle ActionEvent from buttons and menu items */
public void actionPerformed(ActionEvent e) {
String actionCommand = e.getActionCommand();
// Handle button events
if (e.getSource() instanceof JButton) {
if ("Add".equals(actionCommand))
calculate('+');
else if ("Subtract".equals(actionCommand))
calculate('-');
else if ("Multiply".equals(actionCommand))
calculate('*');
else if ("Divide".equals(actionCommand))
calculate('/');
else if (e.getSource() instanceof JMenuItem) {
// Handle menu item events
if ("Add".equals(actionCommand))
calculate('+');
else if ("Subtract".equals(actionCommand))
calculate('-');
else if ("Multiply".equals(actionCommand))
calculate('*');
else if ("Divide".equals(actionCommand))
calculate('/');
else if ("Close".equals(actionCommand))
System.exit(0);
/** Calculate and show the result in jtfResult */
private void calculate(char operator) {
// Obtain Number 1 and Number 2
int num1 = (Integer.parseInt(jtfNum1.getText().trim()));
int num2 = (Integer.parseInt(jtfNum2.getText().trim()));
int result = 0;
// Perform selected operation
switch (operator) {
case '+': result = num1 + num2;
break;
case '-': result = num1 - num2;
break;
case '*': result = num1 * num2;
break;
case '/': result = num1 / num2;
// Set result in jtfResult
jtfResult.setText(String.valueOf(result));
}Okay here is the fixed code... I commented the changes...
basically I changed public void init() to public MortgageApplet() so that the section is a contructor not a method. ( since this class no longer extends Applet, public void init() becomes a method called "init" which has no relation to Applets' init method...)
Then I move most of the variable declarations in the contructor ( formally the init() method ) and declared them as class variables... then initialized them in the construtor "MortgageApplet()"
And now the second button works and you can see the MortgageApplet with textfields and buttons...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;
class MortgageApplet extends JFrame implements ActionListener {
// Made all these class variable, originally they were under public void init()
private JTextField jtfAnnualInterestRate;
private JTextField jtfNumOfYears;
private JTextField jtfLoanAmount;
private JTextField jtfMonthlyPayment;
private JTextField jtfTotalPayment;
private JButton jbtComputeMortgage;
JPanel p1,p2;
// end variable declaration
public MortgageApplet() { // originally was public void init() so it thought is was a method
// now it is a contructor...
jtfAnnualInterestRate = new JTextField();
jtfNumOfYears = new JTextField();
jtfLoanAmount = new JTextField();
jtfMonthlyPayment = new JTextField();
jtfTotalPayment = new JTextField();
jbtComputeMortgage = new JButton("Compute Mortgage");
jtfMonthlyPayment.setEditable(false);
jtfTotalPayment.setEditable(false);
jtfAnnualInterestRate.setHorizontalAlignment(JTextField.RIGHT);
jtfNumOfYears.setHorizontalAlignment(JTextField.RIGHT);
jtfLoanAmount.setHorizontalAlignment(JTextField.RIGHT);
jtfMonthlyPayment.setHorizontalAlignment(JTextField.RIGHT);
jtfTotalPayment.setHorizontalAlignment(JTextField.RIGHT);
// JPanel p1 and p2 declared as class variables
p1 = new JPanel();
p1.setLayout(new GridLayout(5, 2));
p1.add(new Label("Annual Interest Rate"));
p1.add(jtfAnnualInterestRate);
p1.add(new Label("Number of Years"));
p1.add(jtfNumOfYears);
p1.add(new Label("Loan Amount"));
p1.add(jtfLoanAmount);
p1.add(new Label("Monthly Payment"));
p1.add(jtfMonthlyPayment);
p1.add(new Label("Total Payment"));
p1.add(jtfTotalPayment);
p1.setBorder(new TitledBorder("Enter interest rate, year and loan amount"));
p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
p2.add(jbtComputeMortgage);
getContentPane().add(p1, BorderLayout.CENTER);
getContentPane().add(p2, BorderLayout.SOUTH);
setVisible(true); // added this also...
/* the rest is the same - MaxxDmg...*/
// Register listener
jbtComputeMortgage.addActionListener(this); }
/** Handle the "Compute Mortgage" button */
public void actionPerformed(ActionEvent e) {
if (e.getSource() == jbtComputeMortgage) {
// Get values from text fields
double interest = (Double.valueOf(
jtfAnnualInterestRate.getText())).doubleValue();
int year =(Integer.valueOf(jtfNumOfYears.getText())).intValue();
double loan =(Double.valueOf(jtfLoanAmount.getText())).doubleValue();
// Create a mortgage object
Mortgage m = new Mortgage(interest, year, loan);
// Display monthly payment and total payment
jtfMonthlyPayment.setText(String.valueOf(m.monthlyPayment()));
jtfTotalPayment.setText(String.valueOf(m.totalPayment()));
}Have fun...
- MaxxDmg...
- ' No Side '
Maybe you are looking for
-
Converting 7D camera footage to Apple Pro Res 422 HQ
I shot footage with the Canon 7D. I brought the footage to Compressor (latest version as part of Final Cut Studio). I am transcoding the footage to Apple Pro Res 422 HQ for editing in Final Cut Pro 7. A few clips have been transcoded. I open up the o
-
Static abstract methods - how can I avoid them?
Hi everybody, just found out that java doesn't allow static abstract methods nor static methods in interfaces. Although I understand the reasons, I can't think of how to change my design to gain the required behavior without the need of static abstra
-
How can I keep logo background transparent when flattening for web?
Hi, I have a logo designed in Illustrator which I'm bringing into Photoshop to save it for the web. It comes into Photoshop with a transparent background, but when I save it for the web or flatten it, it gets a white background. Can you tell me how t
-
I have logged in to my itunes account on a different pc and none of my files are on there
Hello I have logged in to my itunes account on a different pc and none of my files are on there. Please help!
-
This is something I have noticed only recently and it's not being caused by any of the updates, of that I am sure, BUT shouldn't Finder always be open?? I shouldn't have to click on it's icon in the dock when I restart, should I? I've never had this