I don't understand undo.History

My expectation for app.undoHistory was that anything I can undo in the UI is listed in that array.
This does not seem to be the case.
In my current tests the only way I find to get
b anything
into that array is the script "FindChangeByList.jsx". No action and no script of mine add anything undoable, it seems.
That makes me suspect that I lack some elementary piece of understanding...
What gives?
Thank you
Gerald

Thank you Shane,
thinks: I see my second post before Shane's answer although it was written later. Weird.
For those interested, this seems to work rather nicely:
var anUndoStack = app.activeDocument.undoHistory;
anUndoStack.splice(40);
var anUndoName = app.activeDocument.undoName;
var myDialog = app.dialogs.add({name:"An Seite ausrichten"});
with(myDialog.dialogColumns.add()){
var myUndoDropdown = dropdowns.add({stringList:anUndoStack, selectedIndex:0});
var myResult = myDialog.show();
if(myResult == true){
var mySteps = myUndoDropdown.selectedIndex;
myDialog.destroy();
for (n= 0; n<mySteps;n++) { app.activeDocument.undo(); }
} else{
myDialog.destroy();

Similar Messages

  • Hello. I have a silly problem. When I tick on the navigator, the layer, the undo history and the histogram they don't show up in Elements 10. Of course it was there but just now they are disappeared. I work on a Mac

    Hello. I have a silly problem. When I tick on the navigator, the layer, the undo history and the histogram they don't show up in Elements 10.
    Of course it was there but just now they are disappeared. I work on a Mac
    I am looking forward to your answer
    Anneke

    Quit the editor, then restart it while holding down cmd+shift+option. Keep the keys down till you see a window asking if you want to delete the settings file. You do.

  • HT204088 I don't understand the charges on my account for Itunes.  When I asked for history online, I get no results.  Please help.

    I don't understand the charges on my credit card for itunes.  please help

    Your credit card is only linked to one iTunes account, and you've checked the purchase history on it via your computer's iTunes as per the page that you posted from ? And you don't have iTunes Match or any auto-renewing subscriptions (I'm not sure if they show on the purchase history or not, I don't have any so I can't check) : http://support.apple.com/kb/HT4098
    And you haven't added or changed your credit card details on your iTunes account ? Each time that you do so a small temporary store holding charge may be applied to check that the card details are correct and valid and that it's registered to exactly the same name and address as on your iTunes account - it should disappear off your account within a few days or so. Store holding charge : http://support.apple.com/kb/HT3702
    If you can't find anything on your account's purchase history then you should probably contact your card issuer and get the card cancelled and replaced. You can also contact iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
    I don't know what your second post means.

  • Apparently I don't understand a feature correctly in Mac mail version 6.6

    I am a little confused about what the difference is between a new mailbox and a new smart mailbox in mail. I wanted to create one folder that I can put all my mail into so that I can use my inbox as a sort of a "tickler file". I created a new "mailbox" from the little plus sign at the bottom left of the screen and chose "on my mac" and named it "archive". I moved every email from my inboxes (from multiple email accounts) into this. Was this the correct way to accomplish my goal?
    Unfortunately I felt uncomfortable about this action and then became confused and tried to undo what I had done by moving them back to the inbox so that I could delete the "archive" "mailbox" I had created. I didn't feel like I had accomplished my goal correctly because I don't understand how this new system of "mailboxes and smart mailboxes" fully works and why there are not just simple folders anymore! I deleted the archive mailbox I had created and it apparently deleted ALL of my emails from off of my mac for only one of my email accounts! What is going on!? I just want to simply be able to organize my email workflow with one simple folder. I don't want to set permissions for this folder or anything. Can someone PLEASE help me understand what the heck I've done wrong and how I can get my emails back into mail from my server?
    Thank you!

    Your original action is alright but maybe not what you wanted.
    A mailbox is a physical thing (a folder) you can add locally to your mac.  You can move emails into it and they will leave the IMAP folder they were in and reside on your mac.  What's left on the server is your "tickler" file.
    Alternatively, you could create an IMAP mailbox called archive and put mail there.  Then the mail would still be on the server but in the archive folder.  The easiest way to remember this is "An IMAP mailbox on your mac is a copy/cache/clone of the same mailbox on the server"  that is why you can see it on all your devices and a change on one means a change to all.  If you want access to this "archive" from all your devices, then it needs to be a server IMAP mailbox.
    A smart mailbox is really just a filter.  It's like a saved search.  Mail that meets the search criteria shows up in the smart mailbox.  Nothing is moved.

  • Undo History box (question)

    In PSE9 on my MAC I tick the undo history to show it down the right and when I shut PSE9 it stays on teh desktop and I need to tick it every time I open PSE. I'd just like to tick and have it there always... oh and not get it left behind on my destop.

    I've done it ! I have effects / content showing, followed by Layers/undo history and finally adjustments. I'd not come out of the box to think laterally! It was a simeple case of reducing the size of teh layers box to allow Undo to fit properly. By resizing the boxes Elements now opens and closes exactly as it used to. Phew. Thank you everyone.
    Barbara, I'm one of your wee fans, following pretty much all you mention regarding elements

  • Unless I don't clear any history my financial sites cant remember account numbers.

    I used to be able to clear my history (clear all history) but did't have to re-enter account numbers each time I entered a site. After a nice geek fixed a malware problem (I could get emails but couldn't sign on to the internet using firefox, explorer, etc.) I can't clear anything without having to sign in each time.
    I am really clueless about how to secure things.
    I don't understand which items to NOT clear -- cookies, cache, etc. HELP!!!! The diagrams don't make sense.

    Keep the cookies but clear everything else & it should remember
    log in info.

  • Why did I have to create a new ID when I logged into Communities this morning? Appears I don't have any history anymore either.

    Why did I have to create a new ID when I logged into Communities this morning? Appears I don't have any history anymore either. I used the same browser and username/password (its stored in my browser) and it asked me to fill out my profile and pick an alias. Not sure what the deal was, it appears Apple can't figure out this whole id thing. I've used other community sites for over a decade without having to change my user/profile, I don't understand why this is such a pain with Apple.

    Agreed! I was trying to find out how to reclaim my old name since I use it for all sites. I can't seem to find the answer so I made a new one to ask questions before giving up on it.

  • I can't don't understand code in netbean and it's about Jframe.

    i use netbean to design 2 jframe with some buttons on both frame.
    frame1 is login form, frame2 is mainform. i want to show loginform then click the button1 to show 2nd jframe.
    then i click exit on 2nd jframe and it come back to loginform(frame1).
    i do alot of search on the google and here. i know the basic to show a jframe using
    setVisible or .show() .hide(), etc..
    the problem is what is my jframe variable name in netbean?
    i know i can create an jframe object
    such as: JFrame frame1 = new JFrame(); etc.. (it's ok if the syntax is wrong for now).
    When i use netbean, i drag the Gui components to the Jframe. The jframe is generated by netbean automatically.
    When the main program runs, it calls main() method, follow by :
    public void run() {
    new LoginForm().setVisible(true);
    new LoginForm().setVisible <--- setVisible(true) means show the form.
    and is new LoginForm() create an object from LoginForm class.
    public LoginForm() {
    initComponents();
    When it create a new object, it runs default constructor and calls iniComponoents and finally show the jframe.
    my question is when you create object, you usually declare variable and use variable to hold reference to the object.
    that's why i don't understand how it works here.
    it only create news object, bu no variable to holding it. how do i control this Jframe to show and hide without a reference variable????????????
    Edited by: roadorange on Feb 29, 2008 10:08 PM

    roadorange wrote:
    Encephalopathic . thank your reply so much. your reply is fast. i love it and love this forum.. LOLyou're welcome
    i tried hand-written code, and it looks just fine when design few buttons, labels and textfields.
    The adjustment of buttons(labels) are not that good on the frame.
    However, when you use IDE, you can drag the button on any spot you like in the jframe.... and in the process not learn how Swing works, and lose flexibility and power. Sorry to sound conceited, but I'll match any of your netbeans-created GUI's with one of my own, and mine will likely be better -- and I'm not all that good at this just yet.
    Much luck.

  • I don't understand what's happening with my Music. All the songs that I purchased, that were previously on my phone, now show up a Cloud next to them, but I can't play them. If I touch the Cloud, it turns into a red square but never downloads.

    I don't understand what's happening with my Music. All the songs that I purchased, that were previously on my phone, now show up with a Cloud next to them, but I can't play them. If I touch the Cloud, it turns into a red square, acts like it's downloading (which I can see happening in iTunes), but never downloads. The Cloud just stays there.
    I've sync'd my phone, I've turned it to "show all music" in Settings, I've drag and dropped the songs/albums onto my phone again. I feel like I've tried everything I've seen recommended, but nothing works.
    I've purchased a lot of music from iTunes. It should be there. What's going on?
    P.S. Same thing happening with my purchased books. Ugh.

    Once you successfully add you iTunes library to iTunes Match, you go to Settings>iTunes & App Store on your iOS device and turn on iTunes Match.  Your iTunes Match library will then appear on your iOS device.

  • When we try to buy a new app or update our existing apps, my account settings wont allow me to enter ANY of my credit cards.  It says to contact apple/itunes/support, but when I do, I don't understand how to navigate it to find an answer.  Help!

    when we try to buy a new app or update our existing apps, my account settings wont allow me to enter ANY of my credit cards.  It says to contact apple/itunes/support, but when I do, I don't understand how to navigate it to find an answer.  Help!

    Click here and ask the iTunes Store staff for assistance.
    (108048)

  • Which Mac Pro? More cores=slower speeds? And most of us know the speed matters or FPU for music and I don't understand the faster is for the least amount of procs. And while I get the whole rendering thing and why it makes sense.

    Which Mac Pro? More cores=slower speeds? And most of us know the speed matters or FPU for music and I don't understand the faster is for the least amount of procs. And while I get the whole rendering thing and why it makes sense.
    The above is what the bar says. It's been a while and wondered, maybe Apple changed the format for forums. Then got this nice big blank canvas to air my concerns. Went to school for Computer Science, BSEE, even worked at Analog Devices in Newton Massachusetts, where they make something for apple. 
    The bottom line is fast CPU = more FPU = more headroom and still can't figure out why the more cores= the slower it gets unless it's to get us in to a 6 core then come out with faster cores down the road or a newer Mac that uses the GPU. Also. Few. I'm the guy who said a few years ago Mac has an FCP that looks like iMovie on Steroids. Having said that I called the campus one day to ask them something and while I used to work for Apple, I think she thought I still did as she asked me, "HOW ARE THE 32 CORES/1DYE COMING ALONG? Not wanting to embarrass her I said fine, fine and then hung up.  Makes the most sense as I never quite got the 2,6,12 cores when for years everything from memory to CPU's have been, in sets of 2 to the 2nd power.  2,4,8,16,32,64,120,256,512, 1024, 2048,4196,8192, 72,768.  Wow. W-O-W and will be using whatever I get with Apollo Quad. 
    Peace to all and hope someone can point us in THE RIGHT DIRECTION.  THANK YOU

    Thanks for your reply via email/msg. He wrote:
    If you are interested in the actual design data for the Xeon processor, go to the Intel site and the actual CPU part numbers are:
    Xeon 4 core - E5.1620v2
    Xeon 6 core - E5.1650v2
    Xeon 8 core - E5.1680v2
    Xeon 12 core - E5.2697v2
    I read that the CPU is easy to swap out but am sure something goes wrong at a certain point - even if solderedon they make material to absorb the solder, making your work area VERY clean.
    My Question now is this, get an 8 core, then replace with 2 3.7 QUAD CHIPS, what would happen?
    I also noticed that the 8 core Mac Pro is 3.0 when in fact they do have a 3.4 8 core chip, so 2 =16? Or if correct, wouldn't you be able to replace a QUAD CHIP WITH THAT?  I;M SURE THEY ARE UO TO SOMETHING AS 1) WE HAVE SEEN NO AUDIO FPU OR PERHAPS I SHOULD CHECK OUT PC MAKERS WINDOWS machines for Sisoft Sandra "B-E-N-C-H-M-A-R-K-S" -
    SOMETHINGS UP AND AM SURE WE'LL ALL BE PLEASED, AS the mac pro      was announced Last year, barely made the December mark, then pushed to January, then February and now April.
    Would rather wait and have it done correct than released to early only to have it benchmarked in audio and found to be slower in a few areas- - - the logical part of my brain is wondering what else I would have to swap out as I am sure it would run, and fine for a while, then, poof....
    PEACE===AM SURE APPLE WILL BLOW US AWAY - they have to figure out how to increase the power for 150 watts or make the GPU work which in regard to FPU, I thought was NVIDIA?

  • Generate Report From Template (Excel).vi & don't understand to fill the cells

    I am trying to use the Generate Report From Template (Excel).vi to build my own template, and then fill it with some of my datas. I am trying to replace the "temperature" or "pressure" labels by others, and then fill them with my vi. I don't understand how labview find the location of the labels in the excel template.
    Thanks in advance
    Attachments:
    Excel_Template.xls ‏33 KB
    Generate_Report_From_Template_(Excel).vi ‏120 KB

    You can get the answer to your question by reading the following thread:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=50650000000500000019360100&HTHREAD=000079385000079477000079498000079542000079632&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    The short answer:
    To setup or modify the Named Labels in your Excel template, use Excel's Insert -> Name -> Define command. A name can be defined as a single cell or a block of cells.
    Michael Munroe
    Certified LabVIEW Developer
    www.abcdefirm.com
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • I don't understand my EtreCheck report. What can I do to improve the speed of my Macbook 2010, which became very slow after upgrading to Yosemite?

    I just updated my Macbook (2010) to Yosemite, and it's become very slow. After searching through this community, I downloaded and run EtreCheck, but don't understand what the report means. Please could you help me with what I should do to improve my computer's speed, aside from upgrading my RAM? Thank you so much.
    The report:
    Problem description:
    my macbook is running very slowly after upgrading to yosemite.
    EtreCheck version: 2.0.11 (98)
    Report generated 12 November 2014 1:44:14 pm SGT
    Hardware Information: ℹ️
      MacBook (13-inch, Mid 2010) (Verified)
      MacBook - model: MacBook7,1
      1 2.4 GHz Intel Core 2 Duo CPU: 2-core
      2 GB RAM Upgradeable
      BANK 0/DIMM0
      1 GB DDR3 1067 MHz ok
      BANK 1/DIMM0
      1 GB DDR3 1067 MHz ok
      Bluetooth: Old - Handoff/Airdrop2 not supported
      Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
      NVIDIA GeForce 320M - VRAM: 256 MB
      Color LCD 1280 x 800
    System Software: ℹ️
      OS X 10.10 (14A389) - Uptime: 3:23:3
    Disk Information: ℹ️
      TOSHIBA MK2555GSXF disk0 : (250.06 GB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted> : 210 MB
      Macintosh HD (disk0s2) /  [Startup]: 249.20 GB (25.42 GB free)
      Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
      HL-DT-ST DVDRW  GS23N 
    USB Information: ℹ️
      Western Digital My Passport 0748 1 TB
      S.M.A.R.T. Status: Verified
      EFI (disk1s1) <not mounted> : 210 MB
      tansey (disk1s2) /Volumes/tansey : 999.83 GB (951.98 GB free)
      Apple Inc. Built-in iSight
      Apple Inc. BRCM2070 Hub
      Apple Inc. Bluetooth USB Host Controller
      Apple Inc. Apple Internal Keyboard / Trackpad
    Configuration files: ℹ️
      /etc/hosts - Count: 15
    Gatekeeper: ℹ️
      Mac App Store and identified developers
    Kernel Extensions: ℹ️
      /System/Library/Extensions
      [not loaded] com.NovatelWireless.driver.NovatelWirelessUSBCDCECMControl (3.0.13) Support
      [not loaded] com.NovatelWireless.driver.NovatelWirelessUSBCDCECMData (3.0.13) Support
      [not loaded] com.ZTE.driver.ZTEUSBCDCACMData (1.3.8) Support
      [not loaded] com.ZTE.driver.ZTEUSBMassStorageFilter (1.3.8) Support
      [not loaded] com.novamedia.driver.IceraUSB_MSD_Bypass (1.3.0) Support
      [not loaded] com.novatelwireless.driver.3G (3.0.13) Support
      [not loaded] com.novatelwireless.driver.DisableAutoInstall (3.0.13) Support
      [not loaded] com.option.driver.Option72 (2.15.0) Support
      [not loaded] com.option.driver.OptionHS (3.26.0) Support
      [not loaded] com.option.driver.OptionMSD (1.21.0) Support
      [not loaded] com.option.driver.OptionQC (1.11.0) Support
      [not loaded] com.rim.driver.BlackBerryUSBDriverInt (0.0.39) Support
      [not loaded] com.rim.driver.BlackBerryUSBDriverVSP (0.0.45) Support
      [not loaded] com.vodafone.driver (3.0.9) Support
      [not loaded] com.zte.driver.cdc_ecm_qmi (1.0.1) Support
      [not loaded] com.zte.driver.cdc_usb_bus (1.0.1) Support
      [not loaded] de.novamedia.driver.NMSamsung (0.0.2) Support
      [not loaded] de.novamedia.driver.NMSmartplugSCSIDevice (1.0.1) Support
      [not loaded] de.novamedia.oem.vodafone.vtp.huawei.cdc (0.0.2) Support
      /System/Library/Extensions/NMHuaweiPhonesVTPCDC_106.kext/Contents/PlugIns
      [not loaded] de.novamedia.driver.NMUSBCDCACMControl (3.2.12) Support
      /System/Library/Extensions/NMSamsungDriver_106.kext/Contents/PlugIns
      [not loaded] de.novamedia.driver.NMUSBCDCACMData (3.2.12) Support
      /System/Library/Extensions/NovatelWireless3G.kext/Contents/PlugIns
      [not loaded] com.novatelwireless.driver.3GData (3.0.13) Support
      /System/Library/Extensions/Vodafone.kext/Contents/PlugIns
      [not loaded] com.vodafone.driver.Data (3.0.9) Support
    Startup Items: ℹ️
      HP IO: Path: /Library/StartupItems/HP IO
      HWNetMgr: Path: /Library/StartupItems/HWNetMgr
      HWPortDetect: Path: /Library/StartupItems/HWPortDetect
      Startup items are obsolete and will not work in future versions of OS X
    Problem System Launch Agents: ℹ️
      [failed] com.apple.accountsd.plist
      [failed] com.apple.AirPlayUIAgent.plist
      [failed] com.apple.bird.plist
      [failed] com.apple.CallHistoryPluginHelper.plist
      [failed] com.apple.CallHistorySyncHelper.plist
      [failed] com.apple.cloudd.plist
      [failed] com.apple.coreservices.appleid.authentication.plist
      [failed] com.apple.coreservices.uiagent.plist
      [failed] com.apple.EscrowSecurityAlert.plist
      [failed] com.apple.icloud.fmfd.plist
      [failed] com.apple.iconservices.iconservicesagent.plist
      [failed] com.apple.nsurlsessiond.plist
      [failed] com.apple.pluginkit.pkd.plist
      [failed] com.apple.recentsd.plist
      [failed] com.apple.security.cloudkeychainproxy.plist
      [failed] com.apple.spindump_agent.plist
      [failed] com.apple.telephonyutilities.callservicesd.plist
    Problem System Launch Daemons: ℹ️
      [failed] com.apple.awdd.plist
      [failed] com.apple.cache_delete.plist
      [failed] com.apple.coresymbolicationd.plist
      [failed] com.apple.ctkd.plist
      [failed] com.apple.diagnosticd.plist
      [failed] com.apple.iconservices.iconservicesagent.plist
      [failed] com.apple.iconservices.iconservicesd.plist
      [failed] com.apple.ifdreader.plist
      [failed] com.apple.installd.plist
      [failed] com.apple.MobileFileIntegrity.plist
      [failed] com.apple.nehelper.plist
      [failed] com.apple.nsurlsessiond.plist
      [failed] com.apple.sandboxd.plist
      [failed] com.apple.softwareupdated.plist
      [failed] com.apple.spindump.plist
      [failed] com.apple.sysmond.plist
      [failed] com.apple.tccd.system.plist
      [failed] com.apple.wdhelper.plist
      [failed] com.apple.xpc.smd.plist
      [running] de.novamedia.nmnetmgrd.plist Support
    Launch Agents: ℹ️
      [not loaded] com.adobe.AAM.Updater-1.0.plist Support
      [failed] com.adobe.CS5ServiceManager.plist Support
      [loaded] com.google.keystone.agent.plist Support
      [running] de.novamedia.VodafoneDeviceObserver.plist Support
      [invalid?] SwapperUFi.plist Support
    Launch Daemons: ℹ️
      [loaded] com.adobe.fpsaud.plist Support
      [invalid?] com.adobe.SwitchBoard.plist Support
      [loaded] com.cloudpath.maccmd.plist Support
      [loaded] com.google.keystone.daemon.plist Support
      [loaded] com.microsoft.office.licensing.helper.plist Support
      [invalid?] PPPMonitord.plist Support
    User Launch Agents: ℹ️
      [loaded] com.adobe.ARM.[...].plist Support
      [invalid?] com.akamai.client.plist Support
      [invalid?] com.divx.agent.postinstall.plist Support
      [failed] com.facebook.videochat.[redacted].plist Support
    User Login Items: ℹ️
      Dropbox Application (/Applications/Dropbox.app)
      SurplusMeterAgent UNKNOWN (missing value)
      Google Chrome ApplicationHidden (/Applications/Google Chrome.app)
      HP Scheduler Application (/Library/Application Support/Hewlett-Packard/Software Update/HP Scheduler.app)
    Internet Plug-ins: ℹ️
      o1dbrowserplugin: Version: 5.38.6.0 - SDK 10.8 Support
      Google Earth Web Plug-in: Version: 7.1 Support
      Default Browser: Version: 600 - SDK 10.10
      OfficeLiveBrowserPlugin: Version: 12.2.6 Support
      OVSHelper: Version: 1.1 Support
      AdobePDFViewerNPAPI: Version: 10.1.12 Support
      FlashPlayer-10.6: Version: 15.0.0.152 - SDK 10.6 Support
      Silverlight: Version: 5.1.10411.0 - SDK 10.6 Support
      Flash Player: Version: 15.0.0.152 - SDK 10.6 Mismatch! Adobe recommends 15.0.0.223
      iPhotoPhotocast: Version: 7.0
      googletalkbrowserplugin: Version: 5.38.6.0 - SDK 10.8 Support
      QuickTime Plugin: Version: 7.7.3
      AdobePDFViewer: Version: 10.1.12 Support
      SharePointBrowserPlugin: Version: 14.0.0 Support
      JavaAppletPlugin: Version: 15.0.0 - SDK 10.10 Check version
    User Internet Plug-ins: ℹ️
      OctoshapeWeb: Version: 1.0 Support
    Safari Extensions: ℹ️
      DivX Plus Web Player HTML5 <video>
    3rd Party Preference Panes: ℹ️
      DivX  Support
      Flash Player  Support
    Time Machine: ℹ️
      Skip System Files: NO
      Auto backup: NO - Auto backup turned off
      Volumes being backed up:
      Macintosh HD: Disk size: 249.20 GB Disk used: 223.78 GB
      Destinations:
      Time Machine Backups [Local]
      Total size: 0 B
      Total number of backups: 0
      Oldest backup: -
      Last backup: -
      Size of backup disk: Too small
      Backup size 0 B < (Disk used 223.78 GB X 3)
    Top Processes by CPU: ℹ️
          15% WindowServer
          1% Dropbox
          0% AppleSpell
          0% Skype
          0% imagent
    Top Processes by Memory: ℹ️
      60 MB Google Chrome
      56 MB JavaApplicationStub
      47 MB Skype
      45 MB Finder
      45 MB WindowServer
    Virtual Memory Information: ℹ️
      60 MB Free RAM
      443 MB Active RAM
      398 MB Inactive RAM
      349 MB Wired RAM
      16.91 GB Page-ins
      633 MB Page-outs

    I advise to reply to the one you want to reply to.
    You have had good information here. I will not repeat that here.
    I would like to add:
    you have incompatible software: start in SafeMode, read Woodmeister and see if it is free of issues.
    Akamai is crap software needed or not, Huawei the same.
    It is very possible that the keygenerator you used for generating a key for some softwares has infected your mac.
    The non-regular software with the false key(s) are not compatible probably or generate malware. Luckily you can not update them automatically because the keygenerator blocked the software for contacting the developer... I propose to consider getting rid of those softwares by really good uninstalling.
    You have a beautiful mac, don't degenerate it with crapped software. There are alternatives for expensive software, for example Adobe Photoshop has a free alternative (with a less beautiful interface) in GIMP. And so on.
    Lex

  • I am new to Final Cut Express and don't understand why I am unable to drag transitions into Canvas? Something wrong in my setup? It's not the overlays they are "on" so can anyone advise me please?

    I am new to Final Cut Express and don't understand why I am unable to drag transitions into Canvas? Something wrong in my setup? It's not the overlays they are "on" so can anyone advise me please, by the way the "L" doesn't appear in the bottom left hand corner either? and by the way how can I get rid of that irritating Blue badge saying "AutoFill your contact details" all mine are in "address book" already!

    You can't drag a transition into the canvas. If you're dragginmg a transition from the effects tab you drag it between the edit point of two clips in the timeline.
    Make sure show edit overlays is turned on in the Canvas view popup.

  • Why is this an error???  I don't understand why it is... Help Please

    Hi,
    Ok, I'll preface this by saying there's a lotta code pasted in here but it really quite an easy question, I just need to post all the code so you understand where what came from.
    Now.............the question I'm trying to do is to create an applet that has 2 buttons -- each button when clicked opens an application (one is a simple calculator, the other a Mortgage calculation app). When you click one of the buttons (calc or mortgage), that app opens infront of the 2 button menu so its in "focus". The button on the 2 button menu then switches to a "hide app X" button (ie: "Mortgage", changes to "Hide Mortgage"). Thus if you click the hide button, the app that was opened is hidden, and then that "hide" button switches back to the original "app X" button. Pretty simple.
    Now, I have from my text book an example that does exactly this, with the simple calculator already in it, and with another app (a traffic light thing) where the Mortgage should be in my final product. I also already have the Mortgage applet I need to insert from another book example in place of that Traffic Light portion.
    Now, common sense would dictate that I should be able to just copy my code for the Mortgage applet into the example that has the 2 button menu structure, and overwrite the code I want to get rid of (the traffic light) with the mortgage code & rename the menu buttons. Right?? A simple switch of one thing for another... but therein lies my problem.
    I copied all the Mortgage code in correctly over the traffic lights, switched the button names, tried to compile it but I get one error....
    Exercise12_17.java:52: cannot resolve symbol
    symbol  : method pack ()
    location: class MortgageApplet
            mortgageAppletFrame.pack();I don't understand why..... mortgageAppletFrame.pack(); was a simple rewrite from lightsFrame.pack(); like every other line...... it should work. I've gone over it for 2 days......... Anyone know why it comes up as an error???
    Below, in order going down is (1)my code with the 1 error I can't solve, (2)the original menu example I tried to edit, and (3)the Mortgage app code...........
    Does anyone know what my error is?? Help or a hint would be greatly appreciated........ Thanks.
    My erroring app.......
    // Exercise12_17.java: Create multiple windows
    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 RadioButtonDemo
      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.setSize( 400, 70 );
        frame.setTitle("Exercise 11.8: 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 CheckboxGroup frame
            mortgageAppletFrame.pack();
            jbtMortgage.setText("Hide Mortgage");
            mortgageAppletFrame.setVisible(true);
          else if ("Hide Mortgage".equals(arg)) {
            mortgageAppletFrame.setVisible(false);
            jbtMortgage.setText("Mortgage");
      class MortgageApplet extends JApplet
      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);
      /** 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 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));
    Original 2 button menu example....
    // Exercise11_8.java: Create multiple windows
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Exercise11_8 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 RadioButtonDemo
      RadioButtonDemo lightsFrame = new RadioButtonDemo();
      // Declare two buttons for displaying frames
      private JButton jbtCalc;
      private JButton jbtLights;
      public static void main(String[] args) {
        Exercise11_8 frame = new Exercise11_8();
        frame.setSize( 400, 70 );
        frame.setTitle("Exercise 11.8: Multiple Windows Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
      public Exercise11_8() {
        // Add buttons to the main frame
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(jbtCalc = new JButton("Simple Calculator"));
        getContentPane().add(jbtLights = new JButton("Traffic Lights"));
        // Register the main frame as listener for the buttons
        jbtCalc.addActionListener(this);
        jbtLights.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 ("Traffic Lights".equals(arg)) {
            //show the CheckboxGroup frame
            lightsFrame.pack();
            jbtLights.setText("Hide Traffic Lights");
            lightsFrame.setVisible(true);
          else if ("Hide Traffic Lights".equals(arg)) {
            lightsFrame.setVisible(false);
            jbtLights.setText("Traffic Lights");
         class RadioButtonDemo extends JFrame
      implements ItemListener {
      // Declare radio buttons
      private JRadioButton jrbRed, jrbYellow, jrbGreen;
      // Declare a radio button group
      private ButtonGroup btg = new ButtonGroup();
      // Declare a traffic light display panel
      private Light light;
      /** Main method */
      public static void main(String[] args) {
        RadioButtonDemo frame = new RadioButtonDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(250, 170);
        frame.setVisible(true);
      /** Default constructor */
      public RadioButtonDemo() {
        setTitle("RadioButton Demo");
        // Add traffic light panel to panel p1
        JPanel p1 = new JPanel();
        p1.setSize(200, 200);
        p1.setLayout(new FlowLayout(FlowLayout.CENTER));
        light = new Light();
        light.setSize(40, 90);
        p1.add(light);
        // Put the radio button in Panel p2
        JPanel p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(jrbRed = new JRadioButton("Red", true));
        p2.add(jrbYellow = new JRadioButton("Yellow", false));
        p2.add(jrbGreen = new JRadioButton("Green", false));
        // Set keyboard mnemonics
        jrbRed.setMnemonic('R');
        jrbYellow.setMnemonic('Y');
        jrbGreen.setMnemonic('G');
        // Group radio buttons
        btg.add(jrbRed);
        btg.add(jrbYellow);
        btg.add(jrbGreen);
        // Place p1 and p2 in the frame
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(p1, BorderLayout.CENTER);
        getContentPane().add(p2, BorderLayout.SOUTH);
        // Register listeners for check boxes
        jrbRed.addItemListener(this);
        jrbYellow.addItemListener(this);
        jrbGreen.addItemListener(this);
      /** Handle checkbox events */
      public void itemStateChanged(ItemEvent e) {
        if (jrbRed.isSelected())
          light.turnOnRed(); // Set red light
        if (jrbYellow.isSelected())
          light.turnOnYellow(); // Set yellow light
        if (jrbGreen.isSelected())
          light.turnOnGreen(); // Set green light
    // Three traffic lights shown in a panel
    class Light extends JPanel {
      private boolean red;
      private boolean yellow;
      private boolean green;
      /** Default constructor */
      public Light() {
        turnOnGreen();
      /** Set red light on */
      public void turnOnRed() {
        red = true;
        yellow = false;
        green = false;
        repaint();
      /** Set yellow light on */
      public void turnOnYellow() {
        red = false;
        yellow = true;
        green = false;
        repaint();
      /** Set green light on */
      public void turnOnGreen() {
        red = false;
        yellow = false;
        green = true;
        repaint();
      /** Display lights */
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (red) {
          g.setColor(Color.red);
          g.fillOval(10, 10, 20, 20);
          g.setColor(Color.black);
          g.drawOval(10, 35, 20, 20);
          g.drawOval(10, 60, 20, 20);
          g.drawRect(5, 5, 30, 80);
        else if (yellow) {
          g.setColor(Color.yellow);
          g.fillOval(10, 35, 20, 20);
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 60, 20, 20);
        else if (green) {
          g.setColor(Color.green);
          g.fillOval(10, 60, 20, 20);
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 35, 20, 20);
        else {
          g.setColor(Color.black);
          g.drawRect(5, 5, 30, 80);
          g.drawOval(10, 10, 20, 20);
          g.drawOval(10, 35, 20, 20);
          g.drawOval(10, 60, 20, 20);
      /** Set preferred size */
      public Dimension getPreferredSize() {
        return new Dimension(40, 90);
    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 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));
    Mortgage applet code....
    // MortgageApplet.java: Applet for computing mortgage payments
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    public class MortgageApplet extends JApplet
      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);
      /** 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()));
    }

    Does it have to be an applet?
    If you want the same behaviour as in the code with traffic lights, change
    class MortgageApplet extends JApplet implements ActionListener {
    to
    class MortgageApplet extends JFrame implements ActionListener {
    and change
    public void init() {
    to
    public MortgageApplet() {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • How to check the output of a java card program ?

    Hi, I am new to java card technology.I am trying to run a simple helloworld program given in the java development kit2.2 -windows samples in eclipse3.5. For running I followed the following steps:- 1) Firstly,I went to JCWDE->start 2) then on Project

  • Can't create VM from template on iSCSI

    Hello, I'm trying to create new VM from original Oracle template "OVM_EL5U3_X86_64_PVM_4GB" on iSCSI device without a success. Steps to reproduce: 1) /OVS is mounted as iSCSI block device 2) Original Oracle template is copied into /OVS/seed_pool/OVM_

  • E-Commerce Doc

    Hi CRM Gurus,    I am chandu,can any one kindly help em insending the documentation related to sap crm internet sales my mail id [email protected] Full points would be rewarded Thanks in advance. regards, chandu

  • Using Two different drivers  simultaneously

    I want to use two different type 4 drivers i.e. one driver of ms-access and one of ms-sql server 7 simultanoeously in one java program.please tell me how can i do this ?

  • Starting Tomcat as Service

    Hi, How can I start Tomcat as a service in control Panel. I have windows XP Home . The only purpose to start the Tomcat as a service is to create file "catlina.out" log file for my application. Is there any other way to have the log of my application