Here is my GridBagLayout version of the code

     public void constructGUI()
           c= getContentPane();
          //Construct the menus and their listeners
          JMenu filemenu = new JMenu("File");
          JMenuItem saveas= new JMenuItem ("Save Amortization As");
          saveas.addActionListener(new ActionListener(){
               public void actionPerformed (ActionEvent e)
                    JFileChooser filechooser = new JFileChooser ();
                    filechooser.setFileSelectionMode ( JFileChooser.FILES_ONLY);
                    int result = filechooser.showSaveDialog (null);
                    if (result== JFileChooser.CANCEL_OPTION)
                         return;
                    File filename = filechooser.getSelectedFile();
                    if (filename==null||filename.getName().equals (" "))
                         JOptionPane.showMessageDialog( null, "Invalid File Name", "Invalid FileName", JOptionPane.ERROR_MESSAGE );
                    else {
                         try
                              System.out.println("I am ready to create the streams");
                              FileOutputStream file = new FileOutputStream(filename, true);
                              OutputStreamWriter filestream = new OutputStreamWriter(new BufferedOutputStream(file));
                              String info= "The data is based on"+"\n";
                              filestream.write(info);
                              System.out.println("I wrote the first string called info");
                              String interestdata= "INTEREST:"+" "+interest+"\n";
                              filestream.write(interestdata);
                              String timedata="The amortization period is:"+" "+time+"\n";
                              filestream.write(timedata);
                              String loandata="The money borrowed is:"+" "+moneyFormat.format(loannumber)+"\n";
                              filestream.write(loandata);
                              String totals= "Total of Payments Made:"+" " +moneyFormat.format(totalpayments)+"\n"+"Total Interest Paid:"+"  "+moneyFormat.format(totalinterest)+"\n";
                              filestream.write(totals);
                              String filestring = "PAYMENT NUMBER"+"   " + "PAYMENT" + "   " + " PRINCIPLE" + "   " + "INTEREST" +"   " + " BALANCE" + "\n";
                              filestream.write(filestring);
                              double loannumberkf= loannumber;
                              System.out.println(timenumber);
                              for (int j=1; j<=timenumber ; j++ )
                                   double principlekf=payment-loannumberkf*z;
                                   double balancef=loannumberkf-principlekf;
                                   String display ="\n"+ Integer.toString(j)+"                " + moneyFormat.format(payment)+"        "+ moneyFormat.format(principlekf)+ "     "+moneyFormat.format(loannumberkf*z)+ "     "+ moneyFormat.format(balancef)+"\n";
                                   filestream.write(display);
                                   loannumberkf=loannumberkf-principlekf;
                              filestream.flush();
                              file.close();
                         catch ( IOException ioException )
                              JOptionPane.showMessageDialog (null, "File Does not exist", "Invalid File Name", JOptionPane.ERROR_MESSAGE);
                    }//end of else
             } //end anonymous inner class
          filemenu.add(saveas);
          JMenuItem exit= new JMenuItem ("Exit");
          exit.addActionListener( new ActionListener() {
                    public void actionPerformed (ActionEvent e)
                         System.exit(0);
               } //end anonymous inner class
          ); // end call to ActionListener
          filemenu.add(exit);
          JMenuItem summaries=new JMenuItem ("Save Summaries As");
          MenuHandler menuhandler= new MenuHandler();
          summaries.addActionListener(menuhandler);
          filemenu.add(summaries);
          //construct the second JMenu
          JMenu colorchooser=new JMenu("Color Chooser");
          JMenuItem colorchooseritem=new JMenuItem("Choose Color");
          colorchooseritem.addActionListener (new ActionListener() {
                              public void actionPerformed(ActionEvent e)
                                   color=JColorChooser.showDialog(Mortgagecalculation.this, "Choose a Color", color);
                                   c.setBackground(color);
                                   c.repaint();
                     ); //end of registration
          colorchooser.add(colorchooseritem);
          //third menu
          JMenu service = new JMenu("Services");
          JMenuItem s1= new JMenuItem ("Display Amortization");
          JMenuItem s2= new JMenuItem ("Calender");
          service.add(s1);
          service.add(s2);
          //Create menu bar and add the two JMenu objects
          JMenuBar menubar = new JMenuBar();
          setJMenuBar(menubar);
          menubar.add(filemenu); // end of menu construction
          menubar.add(colorchooser);
          menubar.add(service);
          //set the layout manager for the JFrame
          gbLayout = new GridBagLayout();
          c.setLayout(gbLayout);
          gbConstraints = new GridBagConstraints();
          //construct table and place it on the North part of the Frame
          JLabel tablelabel=new JLabel ("The Table below displays amortization values after you press O.K. on the payments window. Payments window appears after you enter the values for rate, period and loan");
          mydefaulttable = new DefaultTableModel();
               mydefaulttable.addColumn("PAYMENT NUMBER");
               mydefaulttable.addColumn ("PAYMENT AMOUNT");
               mydefaulttable.addColumn ("PRINCIPLE");
               mydefaulttable.addColumn ("INTEREST");
               mydefaulttable.addColumn("LOAN BALANCE");
          Box tablebox=Box.createVerticalBox();   
          mytable=new JTable(mydefaulttable);
          tablelabel.setLabelFor(mytable);
          JScrollPane myscrollpane= new JScrollPane (mytable);
          tablebox.add(tablelabel);
          tablebox.add(myscrollpane);
          //gbConstraints.weightx = 100;
          //gbConstraints.weighty = 50;
          //gbConstraints.fill = GridBagConstraints.BOTH;
          gbConstraints.anchor = GridBagConstraints.NORTH;
          addComponent(tablebox,0,0,3,1,GridBagConstraints.NORTH);
        //c.add (tablebox, BorderLayout.NORTH);
          //create center panel
          JLabel panellabel=new JLabel("Summarries");
          MyPanel panel =new MyPanel();
          panel.setSize (10, 50);
          panel.setBackground(Color.red);
          panellabel.setLabelFor(panel);
          Box panelbox=Box.createVerticalBox();
          panelbox.add(panellabel);
          panelbox.add(panel);
          //gbConstraints.weightx = 50;
          //gbConstraints.weighty = 100;
        //gbConstraints.fill = GridBagConstraints.BOTH;
          gbConstraints.anchor = GridBagConstraints.CENTER;
          addComponent(panelbox,1,1,1,1,GridBagConstraints.CENTER);
          //c.add (panelbox, BorderLayout.CENTER);
          //add time in the SOUTH part of the Frame
          Panel southpanel=new Panel();
          southpanel.setBackground(Color.magenta);
          Date time=new Date();
          String timestring=DateFormat.getDateTimeInstance().format(time);
          TextField timefield=new TextField("The Date and Time in Chicago is:"+" "+timestring, 50);
          southpanel.add(timefield);
          //gbConstraints.weightx = 100;
          //gbConstraints.weighty = 1;
          //gbConstraints.fill = GridBagConstraints.HORIZONTAL;
          gbConstraints.anchor = GridBagConstraints.SOUTH;
          addComponent(southpanel,0,2,3,1,GridBagConstraints.SOUTH);
          //c.add(southpanel, BorderLayout.SOUTH);
          //USE "BOX LAYOUT MANAGER" TO ARRANGE COMPONENTS LEFT TO RIGHT WITHIN THE SOUTH PART OF THE FRAME
          //Create a text area to output more information about the application.Place it in a box and place box EAST
          Font f=new Font("Serif", Font.ITALIC+Font.BOLD, 16);
          string="-If you would like to exit this program\n"+
          "-click on the exit menu item \n"+
               "-if you would like to save the table as a text file \n"+
               "-click on Save As menu item \n"+"-You can reenter new values for calculation\n"+
               " as many times as you would like.\n"+
               "-You can save the summaries also on a different file\n"+
               "-Files are appended";
          JLabel infolabel= new JLabel ("Information About this Application", JLabel.RIGHT);
          JTextArea textarea=new JTextArea(25,25);
          textarea.setFont(f);
          textarea.append(string);
          infolabel.setLabelFor(textarea);
          Box box =Box.createVerticalBox();
          box.add(infolabel);
          box.add(new JScrollPane (textarea));
          //gbConstraints.weightx = 50;
          //gbConstraints.weighty = 100;
          //gbConstraints.fill = GridBagConstraints.BOTH;
          gbConstraints.anchor = GridBagConstraints.SOUTHEAST;
          addComponent(box,2,1,1,1,GridBagConstraints.SOUTHEAST);
          //c.add(box, BorderLayout.EAST);
          //Create the text fields for entering data and place them in a box WEST
          Panel panelwest = new Panel();
          //create the first panelwest and place the text fields in it
          Box box1=Box.createVerticalBox();
          JLabel rate= new JLabel ("Enter Rate", JLabel.RIGHT);
          interestfield=new JTextField ("Enter Interest here and press Enter", 15);
          rate.setLabelFor(interestfield);
          box1.add(rate);
          box1.add(interestfield);
          JLabel period=new JLabel("Enter Amortization Periods", JLabel.RIGHT);
          timenumberfield=new JTextField("Enter amortization period in months and press Enter", 15);
          period.setLabelFor(timenumberfield);
          box1.add(period);
          box1.add(timenumberfield);
          JLabel loan=new JLabel("Enter Present Value of Loan", JLabel.RIGHT);
          loanamountfield =new JTextField ("Enter amount of loan and press Enter", 15);
          loan.setLabelFor(loanamountfield);
          box1.add(loan);
          box1.add(loanamountfield);
          JLabel submit = new JLabel("Press Submit Button to Calculate", JLabel.RIGHT);
          submitbutton= new JButton("SUBMIT");
          submit.setLabelFor(submitbutton);
          box1.add(submit);
          box1.add(submitbutton);
          panelwest.add(box1);
          //Add the panel to the content pane
          //gbConstraints.weightx = 50;
          //gbConstraints.weighty = 100;
          //gbConstraints.fill = GridBagConstraints.BOTH;
          gbConstraints.anchor = GridBagConstraints.SOUTHWEST;
          addComponent(panelwest,0,1,1,1,GridBagConstraints.SOUTHWEST);
          //c.add(panelwest, BorderLayout.WEST);
          //Event handler registration for text fields and submit button
          TextFieldHandler handler=new TextFieldHandler();
          interestfield.addActionListener(handler);
          timenumberfield.addActionListener(handler);
          loanamountfield.addActionListener(handler);
          submitbutton.addActionListener(handler);
          setSize(1000, 700);   
          setVisible(true);
          System.out.println("repainting table, constructor");
          System.out.println("I finished repainting. End of ConstructGUI");
     } // END OF CONSTUCTGUI
     // addComponent() is developed here
     private void addComponent(Component com,int row,int column,int width,int height,int ancor)
          //set gridx and gridy
          gbConstraints.gridx = column;
          gbConstraints.gridy = row;
          //set gridwidth and gridheight
          gbConstraints.gridwidth = width;
          gbConstraints.gridheight = height;
          gbConstraints.anchor = ancor;
          //set constraints
          gbLayout.setConstraints(com,gbConstraints);
          c.add(com);          
     

Quit cross-posting (in different forums) every time you have a question.
Quit multi-posting (asking the same questions twice) when you ask a question.
Start responding to your old questions indicating whether the answers you have been given have been helpfull or not.
Read the tutorial before asking a question. Start with [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use GridBag Layout. Of course its the most difficult Layout Manager to master so I would recommend you use various combinations of the other layout managers to achieve your desired results.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • I keep trying to activate my trial version with the code but it keeps coming up with trial version after i key in the code?

    can anyone help it is version 8?

    I hate to tell you this... they hacked your phone. ONLY the carrier it's locked to can authorize unlocking it. It can't be legitimately unlocked at a 'shop'.
    First, try restoring it in DFU mode and see if it will at least activate with the original carrier it was locked to. If it will, contact that carrier and find out what their unlocking policy is and what you need to do to qualify.
    If it does not work after a DFU mode restore, recycle it responsibly and buy a phone that works. it's hosed.

  • [svn] 1011: Change for supporting newer version of the concurrent library.

    Revision: 1011
    Author: [email protected]
    Date: 2008-03-28 16:42:52 -0700 (Fri, 28 Mar 2008)
    Log Message:
    Change for supporting newer version of the concurrent library. When you remove, you need to
    provide the return value from the schedule method, not the arg you passed in. The api is
    a litte awkward in this regard in that the return value is not a Runnable but the remove
    method expects a Runnable so this code is a little defensive to be sure no one is using
    a version of the code where the return value is not a runnable.
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/util/TimeoutManager.java

    ...It was so bad my English?

  • E71's lock code. I forget the code i've changed, p...

    Here we are T_T i changed the code and now i cant remember it :-s wat should i do to take the code again
    Please help me to solve this problem 

    As already mentioned, you will have to visit a Nokia care point. Bring along a proof of ownership if you have changed the code your self and cannot remember it. The default one should be 12345.

  • CS2, I loved it but now after a computer death and a new install on a new PC the registration program won't take the code and continually needs to bee registered, how do I fix it without buying a new version.

    Some time back I was in college and purchased a copy of CS2, I loved it but now after a computer death and a new install on a new PC the registration program won't take the code and continually needs to bee registered, how do I fix it without buying a new version.

    Oh, for Pete's sake, folks!  The forum FAQs state very clearly that posters should always perform a forum search BEFORE POSTING.
    This question has been asked and answered here ad nauseam here.  I'll bet there are dozens of such questions here in the last few months.
    How To Get Help Quickly
    Before you Post:
    Firstly - have you really checked the 'help' option in the program? Many problems can be solved far faster by getting the answer from the Help File.
    Secondly - check the Forum FAQ folder. There's advice there on many common questions and problems
    Thirdly - use the 'Knowledgebase Search' option near the top of this page. Or you can click here to go to the relevant page and enter your search words there - or just search for 'Photoshop' there to see summaries of all the relevant items.

  • I'm trying to upload the new itunes version because The older one doesnt match with the iphone 5. At one step it is required one code to allow the installation but as It is not the itunes code which one is it ?

    I'm trying to upload the new itunes version because The older one doesnt match with the iphone 5. At one step it is required one code to allow the installation but as It is not the itunes code which one is it ?

    Hello, GwladysPa. 
    Thank you for visiting Apple Support Communities. 
    I believe that the iTunes update is requesting your computer's administrator password to update the application.  Here is the article that explains this process. 
    Mac OS X: Software installations require administrator password
    http://support.apple.com/kb/HT2558
    Cheers,
    Jason H. 

  • HT4009 How long does it take for apple to return with the needed code for in app purchases.  We have a developer working through elance that states he submitted a finalized version last friday to apple and is still waiting to get the code back from Apple?

    We are being told by our elance developer that he is just waiting on apple to return the code for in app purchases with our app.  he says he had to submit a complete version before they would give it to him and that he did that last friday.  Needless to say i don;t beleive him.  Can anyone validate for me the process of getting the code installed into our app and how long it should really take.

    I'd say an average of one week, depending on backlog. Expect two if you are outside the US.
    The outage has caused some lingering effects that seem to be delaying things for some, however.
    Patience is key in all things when it comes to being a developer

  • HT1212 My daughter has tried too many times to put her password in, but she disabled it. And itunes keeps telling me I need to put the code in on it. What do I do?

    May daughter has tried too many times to put her passcode in and she disabled it. when I hook it to itunes, it's telling to put the code in. what do I do now?

    Read the article you linked

  • I work for the County and we purchased a copy of Adobe Photoshop CS2 long ago.  The person that did the order is no longer here.  All I have is the CD Disk that is new but i did not know the key code is.  Is there a way to get the keycode for this?

    I work for the County and we purchased a copy of Adobe Photoshop CS2 long ago.  The person that did the order is no longer here.  All I have is the CD Disk that is new but i did not know the key code is.  Is there a way to get the keycode for this?

    It would not work anyway. The activation servers have been retired and Adobe has provided a new CS2 download along with a new serial number for CS2 owners.
    Download Acrobat 7 and CS2 products
    Gene

  • HT2736 Having emailed myself a gift voucher, I can't redeem the code. Everytime I try it tells me I need Itunes, but I have the most up to date version - help!

    Having emailed myself a gift voucher, I can't redeem the code
    Everytime I try via the email link, it keeps telling me I need to have Itunes
    I have the most up to date version, but nothing seems to allow the Pc (hp) to open it - can anybody help?

    If this page doesn't help then you will need to try contacting iTunes support (you will need to give them as much of the serial number and activation code from the card as you can read) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

  • I have tried another exercise, but again I will need help, here's the code

    hi,
    I have another problem. here's the question pluss the code.
    public interface Patient{
    public void doVisit(float hour);
    public boolean hospitalize();
    1. I will need to write a class name OrdinaryPatient which extends Patient.
    the class will include value int that his name age and another value that will be boolean
    of disease.
    I have to do two constructors. one that don't get values and give them default and the other one
    that does get values.
    another method name docVisit which get a visit to the doctor time visit and will print a message.
    the method hospitalize will hospitalize the patient (and if he will have disease he will get true).
    and for age I have to write methods of get and set.
    2. I will need to write a class of Hipochondriac that extends from OrdinaryPatient.
    I have to do two constructors. one that don't get values and make default and the other one that do get values.
    I will need to ade int by the name of numberOfHospitalize.
    I will need to move the method hospitalize that it will be possible to hospitalize the hypochondriac
    on with the value numberOfHospitalize that his small from 5 and if he will hospitalize he will return
    the value true.
    3. write class PatientClass which will be the method main.
    do 10 objects from OrdinaryPatient, 5 that don't get values and 5 will get randomaly age and
    chronic disease with true.
    do 10 objects from Hipochonidraic, 9 that don't get values and one get all of them.
    save all objects in value from Patinet.
    print for each of them their age.
    print for the OrdinaryPatient alone the method of Hospitalize.
    ok, here's what I did.
    1. OrdinaryPatient
    pbulic class OrdinaryPatient implements Patient{
    private int age;
    private boolean disease;
    public OrdinaryPatient(){
    this.disease=false;
    this.age=0;
    public OrdinaryPatient(int age,boolean ddisase){
    this.disease=disease;
    this.age=age;
    public int getAge(){
    return age;
    public void setDisease(boolean disease){
    this.disease=disease;
    public void setAge(int age){
    this.age=age;
    public void docVisit(){
    System.out.println("Patient's visit is one hour");
    public boolean hospitalize(){
    return false;
    2. public class Hipochondriac extends OrdinaryPatient{
    private = numberOfHospitalize;
    public Hipochondriac();
    super();
    numberOfHospitalize=0;
    public Hipochondriac(int age, boolean diseased, int numberOfHospitalize){
    super(age.diseased);
    setnumberOfHospitalize(numberofHospitalize);
    from here I don't know how to continue.
    3. public class PatientClass{
    public static void main(String args[]){
    patient patinets= new patient[20];
    for (int i=0; i<5; i++){
    patients= new OrdinaryPatient();
    from i'm stuck!!!
    if you can help me to improve it I will appriciate it...
    Einat

    here my result.
    1. public interface Patient{
         public void docVisit(float hour_;
         public boolean hospitalize();
    public class OrdinaryPatient extends Patient
         private int age;
         private boolean disease;
    //constructors
         public OrdinaryPatient(){
              age=20;
              disease=true;
         public OrdinaryPatient(int age, boolean disease) {
              setAge(age);
              this.disease=disease;
    //methods
         public int getAge() {
              return age;
         public void setAge(boolean disease) {
              if(age>0 && age<120)
                   this.age=age;
         //overriding methods.
         public void docVisit(float hour) {
              System.out.println("your visit turn is at "+hour");
         public boolean hospitalize(){
              System.out.println("go to hospital");
              if(disease)
                   return true;
              else
                   return false;
    2. public class Hipochondriac extends OrdinaryPatient{
         private int numberOfHospitalize;
    //constructors
         public Hipochondriac(){
         public Hipochondriac(int age, boolean disease, int numberOfHospipitalize){
              setAge(age);
              this.disease=disease;
              this.numberOfHospitalize=numberOfHospitalize
         //methods
         public int getNumberOfHospitalize(){
              return numberOfHospitalize;
         public void setNumberOfHospitalize(int numberOfHostpitalize){
              if(numberOfHospitalize>0)
                   this.numberOfHospitalize=numberOfHospitalize;
         public boolean hospitalize(){
              if(numberOfHospitalize<5)
                   System.out.println("go to hospital");
                   numberOfHospitalize++;
                   return true;
              else
                   return false;
    3. public class PatientClass
         //constructors
         private PatientClass(String[] args){
              //private methods helps to build the object.
              intialArr(args);
              printAge();
              gotHospital();
    //methods.
    private void intialArr(String[] args){
         int i;//array index
         for(i=0;i<arr.lents/2;i+=2)
              arr=new OrdinaryPatient();
              arr[i+1]=new OridnaryPatient((int)(Math.random()*121),true);
         for(;i<=arr.length-2;i++)
              arr[i]=new Hipochondriac();
         arr[i]=new Hipochondriac(Interget.parseINt(args[0]),
         private void printAge(){
              for(int i=0;i<arr.length;i++)
                   System.out.println(((OrdinaryPatient)arr[i]).getAge());
         private void gotoHospital(){
              for(int i=0;i<arr.length;i++)
    //checking for ordinarypatient objects only
                   if(!(arr[i] instanceof Hipochondriac))
                        //dont need casting
                        arr[i].hospitalize()[
         //main method
         public static void main(String[] args)
              //setting the commandLine array from the main to PatientClass object
              PatientClass pc=new PatientClass(args);
    let me know if it's seems logic to you.
    thank you, Einat     

  • [svn:bz-trunk] 20754: My latest EndpointPushNotifier change changed the style of the code quite a bit  (sorry for that, it was my IDE settings getting in the loop here) I only changed one char line 389.

    Revision: 20754
    Revision: 20754
    Author:   [email protected]
    Date:     2011-03-10 03:36:05 -0800 (Thu, 10 Mar 2011)
    Log Message:
    My latest EndpointPushNotifier change changed the style of the code quite a bit (sorry for that, it was my IDE settings getting in the loop here) I only changed one char line 389.
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/client/EndpointPushNotifier.java

    I seem to have fixed it by putting <div  class="clearfloat"></div> after the navigation bar?

  • I want to make invisible mode ffield (Version) in the transaction code MD61

    I want to make invisible mode ffield (Version) in the transaction code MD61.
    Can anybody tell me how to do it with coding.
    Thanks

    Refer the thread for details about coding-
    BAPI_REQUIREMENTS_CREATE
    Reards,
    Amit

  • [svn:fx-trunk] 13693: Initial version of the mirroring layout code.

    Revision: 13693
    Revision: 13693
    Author:   [email protected]
    Date:     2010-01-21 12:25:54 -0800 (Thu, 21 Jan 2010)
    Log Message:
    Initial version of the mirroring layout code.  Only Spark is supported.  API revisions for this feature are very likely to follow.
    QE notes:
    Doc notes:
    Bugs:
    Reviewer: Evtim
    Tests run: All Mustella tests pass
    Is noteworthy for integration: yes
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as
        flex/sdk/trunk/frameworks/projects/framework/defaults.css
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/MatrixUtil.as
        flex/sdk/trunk/frameworks/projects/spark/defaults.css
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicEleme nt.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/CheckBoxSkin.mxml
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/PanelSkin.mxml
        flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/BitmapUtil.as
    Added Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutDirection.as

    Jon Fritz II wrote:
    If I had a site where the target audience was largely Asian or South American, I'd care about IE6 and 7.
    That hasn't come up yet.
    IE8 still shows up at decent percentage in the analytics for certain sites so I've flip-flopped back and forth whether I will support it a few times.
    I say "good enough" a lot more while testing in IE8 than I used to, that's for sure.
    IE 8 I can understand but just had a quick flick through some of my web sites stats and IE6 and IE7 are under 1 per-cent nearer to 0.5%. If I'm honest I was surprised to see in some instances IE 8 still getting as much as 8 percent.

  • Please Please Help with Projectile Project Here are the Codes

    I've got three(3) classes a Model, a view, and a controller.
    This is a project about projectiles.it is an animation of a cannonball being fired from a cannon and travelling under the effect of gravity.A cannon fired at angle 'a' to the horizontal and with an initial speed 's', will have an initial velocity given by:
    vx := s * cos(a);//velocity x equals the speed multiply by the cosine of angle a.
    vy := s * sin(a);//velocity y equals the speed multiply by the sine of angle a.
    Here are the code.
    Model:
    /** Cannon specifies the expected behaviour of a cannon*/
    public class Cannon{
    public static final int TICK = 60;
    private int velocity = 0;
    private static final double gravity = .098f;
    private double angle = 0;
    // distances & positions are meausred in pixels
    private int x_pos; // ball's center x-position
    private int y_pos; // ball's center y-position
    // speed is measured in pixels per `tick'
    private int x_velocity; // horizonal speed; positive is to the right
    private int y_velocity; // vertical speed; positive is downwards
    public Cannon() {
    velocity = 3;
    angle = 60;
    angle = radians(angle);
    x_pos = 0;
    y_pos = 385;
    /** shoot fires a shot from the cannon*/
    public void shoot(){
    move();
    /**reload reloads the cannon with more shorts*/
    public void reload() {
    /** changeAngle changes the angle of the canon
    * @params value - the amount to add or subtract from the current angle value*/
    public void changeAngle(double value) {
    angle = (double)value;
    angle = radians(angle);
    /** getAngle returns the current angle value of the cannon*/
    public double getAngle() {
    return angle;
    /** changeVelocity changes the speed at which a cannon ball that is to be fire will travel at
    * @params value - the new speed at which the user wants a cannon ball to travel at.*/
    public void changeVelocityX(int value){
    x_velocity = x_velocity * (int)Math.cos(value);
    public void changeVelocityY(int value){
    y_velocity = y_velocity * (int)Math.sin(value);
    /** getVelocity returns the current velocity value of the cannon*/
    public int getVelocityX() {
    return x_velocity;
    public int getVelocityY() {
    return y_velocity;
    /** getGravity returns the current gravity value of the cannon*/
    public double getGravity() {
    return gravity;
    public int xPosition(){
    return x_pos;
    public int yPosition(){
    return y_pos;
    public void move(){
    double dx = getVelocityX() * Math.cos(getAngle());
    double dy = getVelocityY() * Math.sin(getAngle());
    x_pos+=dx;
    y_pos-=dy;
    double radians (double angle){
    return ((Math.PI * angle) / 180.0);
    View:
    import java.awt.*;
    import javax.swing.*;
    /** CannonView displays a cannon being fired.*/
    public class CannonView extends JPanel{
    /** DISPLAY_SIZE specifies the overall display area of the cannon and the bucket.*/
    public static final int DISPLAY_AREA_SIZE = 600;
    public RotatablePolygon rectangle;
    public RotatablePolygon triangle;
    public Cannon cannon;
    public CannonView(Cannon c) {
    this.setPreferredSize(new Dimension(600,450));
    this.setBackground(Color.black);
    cannon = c;
    int xRectangle[] = {0,0,40,40,0};
    int yRectangle[] = {400,300,300,400,400};
    int xTriangle[] = {0,20,40,0};
    int yTriangle[] = {300,280,300,300};
    rectangle = new RotatablePolygon (xRectangle, yRectangle, 5,20,350);
    // rectangle.setPosition (100, 100);
    // triangle = new RotatablePolygon (xTriangle, yTriangle, 4,0,290);
    triangle = new RotatablePolygon (xTriangle, yTriangle, 4,20,350);
    //triangle.setPosition (100, 100);
    JFrame frame = new JFrame();
    frame.getContentPane().add(this);
    frame.pack();
    frame.setVisible(true);
    frame.setTitle("Width = " + frame.getWidth() + " , Height = " + frame.getHeight());
    /** drawBucket draws a bucket/target for which a moving cannon ball should hit.
    * @param g - the graphics pen for which the drawing should occur.*/
    public void drawBucket(Graphics g) {
    g.setColor(Color.red);
    int xvalues[] = {495, 519, 575, 595, 495};
    int yvalues[] = {340, 400, 400, 340, 340};
    Polygon poly1 = new Polygon (xvalues, yvalues, 5);
    g.fillPolygon(poly1);
    g.setColor(Color.white);
    g.fillOval(495, 328, 100, 24);
    Graphics2D g2d = (Graphics2D)g;
    g2d.setStroke(new BasicStroke(2));
    g.setColor(Color.red);
    g.drawOval(495, 328, 100, 24);
    g.drawOval(495,311,100,54);
    /** drawCannon draws a cannon
    * @param g - the graphics pen that will be used to draw the cannon.*/
    public void drawCannon(Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    g.setColor(Color.red);
    g2.fill(rectangle);
    g.setColor(Color.orange);
    g2.fill(triangle);
    g.setColor(Color.blue);
    g.fillOval(95, 340, 60, 60);
    g.setColor(Color.magenta);
    for (int i = 0; i < 6; i++){
    g.fillArc(95, 340, 60, 60, i* 60, 30);
    g.setColor(Color.black);
    g.fillOval(117, 362, 16, 16);
    /** drawCannonShots will draw the actual number of shots already used by the cannon
    * @param g - the graphics pen that will be used to draw the shots of the cannon.*/
    public void drawCannonShots(Graphics g) {
    g.setColor(Color.orange);
    g.fillOval(cannon.xPosition(),cannon.yPosition(),16,16);
    /** drawTrail will draw a trail of smoke to indicate where a cannon ball has passed
    * @param g - the graphics pen used to draw the trail.*/
    public void drawTrail(Graphics g){}
    /**drawGround draws the ground for which the cannon sits*/
    public void drawGround(Graphics g) {
    g.setColor(Color.green.brighter());
    g.fillRect(0,400,600,50);
    /** drawMovingCannonBall draw a cannon ball moving at a certain speed (velocity),
    * with a certain amount of gravitational acting upon it, at a certain angle.
    * @params g - the graphics pen used to draw the moving cannon ball.
    * @params gravity - the value of gravity.
    * @params velocity - the speed at which the ball is travelling.
    * @params angle - the angle at which the ball was shot from.*/
    public void drawMovingCannonBall(Graphics g, double gravity, double velocity, double angle){}
    /** paintComponent paints the cannon,bucket
    * @param g - graphics pen.*/
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    drawGround(g);
    drawBucket(g);
    drawCannon(g);
    drawCannonShots(g);
    Controller
    /** CannonController controls the interaction between the user and a cannon*/
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class CannonController extends JFrame{
    public JMenuBar jMenuBar2;
    public JMenu jMenu2;
    public JMenuItem jMenuItem1;
    public JMenu jMenu3;
    public JMenuItem jMenuItem2;
    public JLabel angleLabel, velocityLabel;
    public JTextField angleTextField, velocityTextField;
    public JButton fireButton, reloadButton;
    public JSlider angleSlider, velocitySlider;
    private CannonView view;
    private Cannon cannon;
    int oldValue, newValue;
    public CannonController(Cannon acannon) {
    cannon = acannon;
    view = new CannonView(cannon);
    loadControls();
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    oldValue = angleSlider.getValue();
    newValue = oldValue + 1;
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    this.setSize(328,308);
    this.setLocation(view.getWidth()-this.getWidth(),0);
    /** loadControl loads all of the GUI controls that a
    * user of the cannon animation will use to interact with the program*/
    public void loadControls() {
    jMenuBar2 = new JMenuBar();
    jMenu2 = new JMenu();
    jMenuItem1 = new JMenuItem();
    jMenu3 = new JMenu();
    jMenuItem2 = new JMenuItem();
    angleLabel = new JLabel();
    velocityLabel = new JLabel();
    angleTextField = new JTextField();
    velocityTextField = new JTextField();
    fireButton = new JButton();
    reloadButton = new JButton();
    angleSlider = new JSlider();
    velocitySlider = new JSlider();
    jMenuBar2.setBorderPainted(false);
    jMenu2.setModel(jMenu2.getModel());
    jMenu2.setText("File");
    jMenuItem1.setText("Exit");
    jMenuItem1.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem1ActionPerformed(evt);
    jMenu2.add(jMenuItem1);
    jMenuBar2.add(jMenu2);
    jMenu3.setText("Help");
    jMenuItem2.setText("About this Program");
    jMenuItem2.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem2ActionPerformed(evt);
    jMenu3.add(jMenuItem2);
    jMenuBar2.add(jMenu3);
    getContentPane().setLayout(null);
    setTitle("Cannon Controller Form");
    setResizable(false);
    setMenuBar(getMenuBar());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    exitForm(evt);
    angleLabel.setText("Angle:");
    getContentPane().add(angleLabel);
    angleLabel.setLocation(10, 20);
    angleLabel.setSize(angleLabel.getPreferredSize());
    velocityLabel.setText("Velocity:");
    getContentPane().add(velocityLabel);
    velocityLabel.setLocation(10, 80);
    velocityLabel.setSize(velocityLabel.getPreferredSize());
    angleTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(angleTextField);
    angleTextField.setBounds(280, 20, 30, 20);
    velocityTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(velocityTextField);
    velocityTextField.setBounds(280, 80, 30, 20);
    fireButton.setToolTipText("Click to fire a shot");
    fireButton.setText("Fire");
    fireButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    fireButtonMouseClicked(evt);
    getContentPane().add(fireButton);
    fireButton.setBounds(60, 160, 80, 30);
    reloadButton.setToolTipText("Click to reload cannon");
    reloadButton.setText("Reload");
    reloadButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    reloadButtonMouseClicked(evt);
    getContentPane().add(reloadButton);
    reloadButton.setBounds(150, 160, 80, 30);
    angleSlider.setMinorTickSpacing(30);
    angleSlider.setPaintLabels(true);
    angleSlider.setPaintTicks(true);
    angleSlider.setMinimum(0);
    angleSlider.setMajorTickSpacing(60);
    angleSlider.setToolTipText("Change the cannon angle");
    angleSlider.setMaximum(360);
    angleSlider.setValue(0);
    angleSlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    angleSliderStateChanged(evt);
    getContentPane().add(angleSlider);
    angleSlider.setBounds(60, 20, 210, 40);
    velocitySlider.setMinorTickSpacing(5);
    velocitySlider.setPaintLabels(true);
    velocitySlider.setPaintTicks(true);
    velocitySlider.setMinimum(1);
    velocitySlider.setMajorTickSpacing(10);
    velocitySlider.setToolTipText("Change the speed of the cannon ball");
    velocitySlider.setMaximum(28);
    velocitySlider.setValue(3);
    velocitySlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    velocitySliderStateChanged(evt);
    getContentPane().add(velocitySlider);
    velocitySlider.setBounds(60, 80, 210, 50);
    setJMenuBar(jMenuBar2);
    pack();
    private void reloadButtonMouseClicked(MouseEvent evt) {
    reloadButtonClick();
    private void fireButtonMouseClicked(MouseEvent evt) {
    fireButtonClick();
    /** firstButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's fire method*/
    public void fireButtonClick() {
    // JOptionPane.showMessageDialog(null,"You click Fire");
    cannon.shoot();
    view.repaint();
    /** reloadButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's reload method*/
    public void reloadButtonClick() {
    JOptionPane.showMessageDialog(null,"reload");
    private void angleSliderStateChanged(ChangeEvent evt) {
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    view.rectangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    view.triangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    cannon.changeAngle(angleSlider.getValue());
    view.repaint();
    private void velocitySliderStateChanged(ChangeEvent evt) {
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    cannon.changeVelocityX(velocitySlider.getValue());
    private void gravitySliderStateChanged(ChangeEvent evt) {
    private void jMenuItem1ActionPerformed(ActionEvent evt) {
    System.exit (0);
    private void jMenuItem2ActionPerformed(ActionEvent evt) {
    String message = "Cannon Animation\n"+
    "Based on the Logic of Projectiles";
    JOptionPane.showMessageDialog(null,message,"About this program",JOptionPane.PLAIN_MESSAGE);
    /** Exit the Application */
    private void exitForm(WindowEvent evt) {
    System.exit (0);
    /** Pause execution for t milliseconds. */
    private void delay (int t) {
    try {
    Thread.sleep (t);
    } catch (InterruptedException e) {}
    public static void main(String [] args){
    Cannon cn = new Cannon();
    CannonController control = new CannonController(cn);
    control.setTitle("Test");
    control.setVisible(true);
    if the cannon ball land in the bucket it should stop and the animation should indicate a 'hit' in some way. maybe by displaying a message.
    if the cannonball hits the outside of the bucket it should bounce off.
    Extra Notes.
    1) The acceleration due to gravity is 9.8m/s to the (power of (2) eg s2.
    2) The distance travelled in time t by a body with initial velocity v under constant acceleration a is:
    v * t + a * t.pow(2) div 2;
    The velocity at the end of time t will be v + a * t.
    Distance is measure in pixels rather than meter so for simplicity we use 1 pixel per meter
    When i pressed the fire button nothings happens. I'm going crazy. Please please help!

    Here is the interface specification for the RotatablePolygon class. I do not have the actual .java source.
    Thanks
    Class RotatablePolygon
    java.lang.Object
    |
    --java.awt.geom.Area
    |
    --RotatablePolygon
    All Implemented Interfaces:
    java.lang.Cloneable, java.awt.Shape
    public class RotatablePolygon
    extends java.awt.geom.Area
    Polygons which can be rotated around an `anchor' point and also translated (moved in the x and y directions).
    Constructor Summary
    RotatablePolygon(int[] xs, int[] ys, int n, double x, double y)
    Create a new RotatablePolyogon with given vertices and anchor point (x,y).
    Method Summary
    double getAngle()
    The current angle of rotation.
    double getXanchor()
    x-coordinate of the anchor point.
    double getYanchor()
    y-coordinate of the anchor point.
    void rotate(double da)
    Rotate the polygon from its current position by angle da (in radians) around the anchor.
    void rotateDegrees(double da)
    Rotate the polygon from its current position by angle da (in degrees) around the anchor.
    void setAngle(double a)
    Set the angle of rotation of the polygon to be angle a (in radians) around the anchor.
    void setAngleDegrees(double a)
    Set the angle of rotation of the polygon to be angle a (in degrees) around the anchor.
    void setPosition(double x, double y)
    Shift the polygon's position to put its anchor point at (x,y).
    void translate(double dx, double dy)
    Shift the polygon's position and anchor point by given amounts.
    Methods inherited from class java.awt.geom.Area
    add, clone, contains, contains, contains, contains, createTransformedArea, equals, exclusiveOr, getBounds, getBounds2D, getPathIterator, getPathIterator, intersect, intersects, intersects, isEmpty, isPolygonal, isRectangular, isSingular, reset, subtract, transform
    Methods inherited from class java.lang.Object
    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Constructor Detail
    RotatablePolygon
    public RotatablePolygon(int[] xs,
    int[] ys,
    int n,
    double x,
    double y)
    Create a new RotatablePolyogon with given vertices and anchor point (x,y).
    REQUIRE: xs.length >= n && ys.length >= n
    Parameters:
    xs - x-coordinates of vertices
    ys - y-coordinates of vertices
    n - number of vertices
    x - x-coordinate of the rotation anchor
    y - y-coordinate of the rotation anchor
    Method Detail
    setPosition
    public void setPosition(double x,
    double y)
    Shift the polygon's position to put its anchor point at (x,y).
    Parameters:
    x - new x-coordinate for anchor point
    y - new y-coordinate for anchor point
    translate
    public void translate(double dx,
    double dy)
    Shift the polygon's position and anchor point by given amounts.
    Parameters:
    dx - amount to shift by in x-direction
    dy - amount to shift by in y-direction
    setAngle
    public void setAngle(double a)
    Set the angle of rotation of the polygon to be angle a (in radians) around the anchor.
    Parameters:
    a - angle to rotate to, in radians
    setAngleDegrees
    public void setAngleDegrees(double a)
    Set the angle of rotation of the polygon to be angle a (in degrees) around the anchor.
    Parameters:
    a - angle to rotate to, in degrees
    rotate
    public void rotate(double da)
    Rotate the polygon from its current position by angle da (in radians) around the anchor.
    Parameters:
    da - angle to rotate by, in radians
    rotateDegrees
    public void rotateDegrees(double da)
    Rotate the polygon from its current position by angle da (in degrees) around the anchor.
    Parameters:
    da - angle to rotate by, in degrees
    getAngle
    public double getAngle()
    The current angle of rotation.
    getXanchor
    public double getXanchor()
    x-coordinate of the anchor point.
    getYanchor
    public double getYanchor()
    y-coordinate of the anchor point.

Maybe you are looking for

  • How do I get rid of the useless grey keyboard on my mini?

    I have been using a bluetooth keyboard and have had no trouble with the touch keyboard when the BT is off.  This week though a darker grey keyboard appeared that does not go away when the BT is off AND it does not function.  How do I get back to the

  • Two Game Center Accounts on One Apple ID

    Hello, From the looks of things I'm the only one experiencing this issue and it's really starting to bug me out unfortunately. There's an APP that I use on my spare time. When I first installed the app it was registered under my Apple ID and Nickname

  • Failed to install Adobe Photoshop CS5.1 on Windows 7 64bit

    I get these errors pop up when i tried to install it on my 64bit Windows 7 laptop. I searched for many solutions online, but none worked for me, so I hope that someone can help me to solve this problem - 0 fatal error(s), 64 error(s), 62 warning(s) W

  • Slideshows on HD TV's

    I am using DVDSP to make slideshows. When I am in the Simulate mode of DVDSP, I can switch from SD to HD720, and to HD 1080. When I go to the HD modes, the picture gets burry. How can I made Standard DVD's using my slideshows from DVDSP that will not

  • How to Sort Pictures Into Events in iPhoto

    Hi, I have different events listed in my iPhoto based on the dates that I imported the pictures. I'm trying to sort the pictures into specific events but I keep having problems. I've tried flagging the pictures and then the adding flagged photos to s