Quick Homework Question (Moving a ball)

I took a course in C and now im into java. I never created any graphics in C. I need to finish a java applet that makes a red ball appear in the center of a blue background and then move down and up the screen.
Any information of how to make it move would help...
This is what I have so far:
//This applet draws an animated bouncing ball with uniform speed.
//The ball starts at the center of the graphics page and bounces off
//the top and bottom
import java.awt.*;
import java.applet.Applet;
public class BouncingBall extends Applet {
    //Dimensions of Applet:
    public final int width = 500;
    public final int height = 500;
    //Size and speed of ball:
    public final int diameter = 20;
    public final int speed = 5;
    //Milliseconds to pause between frames:
    public final int pause = 20;
    public void paint (Graphics page) {
        setBackground(Color.blue);
        page.fillOval(250 - diameter/2, 250 + diameter/2, diameter, diameter);
        page.setColor(Color.red);
        //Loop forever;
        while (true) {
            //if (x_pos > 500- diamter/2)
            //Pause between frames:
            try { Thread.sleep(pause) ; } catch (Exception e) { };
//End-of-FileThanks

I just can't get the ball to move now. Can anyone find what I am doing wrong?
//This applet draws an animated bouncing ball with uniform speed.
//The ball starts at the center of the graphics page and bounces off
//the top and bottom
//Known Problems:
// - None
import java.awt.*;
import java.applet.Applet;
public class BouncingBall extends Applet {
    //Dimensions of Applet:
    public final int width = 500;
    public final int height = 500;
    //Size and speed of ball:
    public final int diameter = 20;
    public final int speed = 5;
    //Milliseconds to pause between frames:
    public final int pause = 20;
    int y = 250;
    public void paint (Graphics page) {
        page.setColor(Color.blue);
        page.fillRect(0,0,500,500);
        page.setColor(Color.red);
        page.fillOval(250 - 10, y - 10, 20, 20);
        //Loop forever;
    public void run()
        while (true) {
            if (y<=450){
                y--;
                repaint();
                return;
            else if (y>=10){
                y++;
                repaint();
                return;
            //Pause between frames:
            try { Thread.sleep(pause) ; } catch (Exception e) { };
}Thanks again

Similar Messages

  • Quick homework question.....

    If anyone can help me out with this I would greatly appreciate it. Its just a basic program that where I enter an integer and tell whether or not its even or odd.
    import java.io.*;
    class binary
         public static void main(String args []) throws IOException
              int a;
              //Entering Values
              BufferedReader inData = new BufferedReader (new InputStreamReader (System.in));
              System.out.print("Enter a integer: ");
              String temp = inData.readLine ();
              a = Integer.parseInt (temp);
         b = (int a % 2);
         if (b == 0)
              System.out.println("Int is even");
         if (b != 0)
              System.out.println("Int is odd");
         }

    Considering your cookie comment, I have to disagree.Look more closely.
    Warnerja asked for confirmation that the OP wasn't looking for someone to "cut-n-paste it and figure out where all your problems are." That's perfectly reasonable, given the number of posts here that are looking for just that and the fact that the OP doesn't seem to be widely known here.
    He then suggested that if the OP was in fact looking for said spoonfeeding and cheating assistance, he could have a cookie.
    That was a sarcastic comment, but warnerja wasn't a jerk to make it, since it was predicated on the OP being a lazy cheater. He didn't say or imply that the OP was one, merely that if he was one, he could have the cookie.
    So the cookie comment only applies of the OP is a jerk. Being sarcastic to someone who's a jerk doesn't make the sarcastor a jerk, since the sarcasm was well and truly earned. And if the OP wasn't looking to cheat (which it appears he wasn't) then the comment doesn't apply to him, so, again, warnerja isn't being a jerk.
    Then I suggested that "cookie" might be a metaphor for "kick in the nuts." Again, the cookie/kick would only be delivered if the OP was looking to cheat, in which case a kick in the nuts is just desserts, not jerkitude.
    QED

  • After editing a photo in another program, the photos return to the library at the end of the grid panel instead of at their original loacation.  How do I avoid this or alternatively, is there a quick way of moving them back to their original position inst

    After editing a photo in another program, the photos return to the library at the end of the grid panel instead of at their original loacation.  How do I avoid this or alternatively, is there a quick way of moving them back to their original position instead of clicking and dragging them?

    Sort your photos by File Name or Capture Date
    Use View->Sort

  • Hi all .hope all is well ..A quick trim question

    Hi all
    Hope all is well ......
    I have a quick trim question I want to remove part of a string and I am finding it difficult to achieve what I need
    I set the this.setTitle(); with this
    String TitleName = "Epod Order For:    " + dlg.ShortFileName() +"    " + "Read Only";
        dlg.ShortFileName();
        this.setTitle(TitleName);
        setFieldsEditable(false);
    [/code]
    Now I what to use a jbutton to remove the read only part of the string. This is what I have so far
    [code]
      void EditjButton_actionPerformed(ActionEvent e) {
        String trim = this.getTitle();
          int stn;
          if ((stn = trim.lastIndexOf(' ')) != -2)
            trim = trim.substring(stn);
        this.setTitle(trim);
    [/code]
    Please can some one show me or tell me what I need to do. I am at a lose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    there's several solutions:
    // 1 :
    //you do it twice because there's a space between "read" and "only"
    int stn;
    if ((stn = trim.lastIndexOf(' ')) != -1){
        trim = trim.substring(0,stn);
    if ((stn = trim.lastIndexOf(' ')) != -1){
          trim = trim.substring(0,stn);
    //2 :
    //if the string to remove is always "Read Only":
    if ((stn = trim.toUpperCase().lastIndexOf("READ ONLY")) != -1){
       trim = trim.substring(0,stn);
    //3: use StringTokenizer:
    StringTokenizer st=new StringTokenizer(trim," ");
        String result="";
        int count=st.countTokens();
        for(int i=0;i<count-2;i++){
          result+=st.nextToken()+" ";
        trim=result.trim();//remove the last spaceyou may find other solutions too...
    perhaps solution 2 is better, because you can put it in a separate method and remove the string you want to...
    somthing like:
    public String removeEnd(String str, String toRemove){
      int n;
      String result=str;
      if ((n = str.toUpperCase().lastIndexOf(toRemove.toUpperCase())) != -1){
       result= str.substring(0,stn);
      return result;
    }i haven't tried this method , but it may work...

  • Quick script question

    Hi all,
    Could anyone advise me if i can add anything within - header('Location: http://www.mysite.co.uk/thankyou.html'); in the script below so as the page
    re- directs back to the main index page after a few seconds ?
    Thankyou for any help.
    <?php
    $to = '[email protected]';
    $subject = 'Feedback form results';
    // prepare the message body
    $message = '' . $_POST['Name'] . "\n";
    $message .= '' . $_POST['E-mail'] . "\n";
    $message .= '' . $_POST['Phone'] . "\n";
    $message .= '' . $_POST['Message'];
    // send the email
    mail($to, $subject, $message, null, '');
    header('Location: http://www.mysite.co.uk/thankyou.html');
    ?>

    andy7719 wrote:
    Mr powers gave me that script so im rather confused at this point in time
    I don't think I "gave" you that script. I might have corrected a problem with it, but I certainly didn't write the original script.
    What you're using is far from perfect, but to suggest it would lay you open to MySQL injection attacks is ludicrous. For you to be prone to MySQL injection, you would need to be entering the data into a MySQL database, not sending it by email.
    There is a malicious attack known as email header injection, which is a serious problem with many PHP email processing scripts. However, to be prone to email header injection, you would need to use the fourth argument of mail() to insert form data into the email headers. Since your fourth argument is null, that danger doesn't exist.
    One thing that might be worth doing is checking that the email address doesn't contain a lot of illegal characters, because that's a common feature of header injection attacks. This is how I would tidy up your script:
    <?php
    $suspect = '/Content-Type:|Bcc:|Cc:/i';
    // send the message only if the E-mail field looks clean
    if (preg_match($suspect, $_POST['E-mail'])) {
      header('Location: http://www.example.com/sorry.html');
      exit;
    } else {
      $to = '[email protected]';
      $subject = 'Feedback form results';
      // prepare the message body
      $message = 'Name: ' . $_POST['Name'] . "\n";
      $message .= 'E-mail: ' . $_POST['E-mail'] . "\n";
      $message .= 'Phone: ' . $_POST['Phone'] . "\n";
      $message .= 'Message: ' . $_POST['Message'];
      // send the email
      mail($to, $subject, $message);
      header('Location: http://www.example.com/thankyou.html');
      exit;
    ?>
    Create a new page called sorry.html, with a message along the lines of "Sorry, there was an error sending your message". Don't put anything about illegal attacks. Just be neutral.
    By the way, when posting questions here, don't use meaningless subject lines, such as "Quick script question". If you're posting here, it's almost certain to be a question about a script. It doesn't matter whether it's quick. Use the subject line to tell people what it's about.

  • Quick Notation Question - Data Rates/Frame Rates/Interlacing

    Finally upgraded to a decent prosumer camera and I'm trying to decipher what the manual is telling me about the many different formats it shoots and and the associated options.  I keep seeing things like "There are two basic shooting modes: 720p and 1080i/p.", which I'm finding confusing.  In my understanding, the "p" in 720p means progressive video and the "i" in 1080i means interlaced.  So what do I make of 1080i/p?
    On top of this, my camera shoots in "native" mode, which drops duplicate frames used in "over 60" formats.  This will give me variations in the notation like:
    720/24pN
    720p Native 60 fps
    1080i/24p
    1080/24PN
    Can someone give me a quick primer about frame rate vs data rate and explain how to read these notations?  I'd appreciate it quite a bit.
    Thanks!

    There are so many cameras, capable of so many different formats that providing a manufacturer and model could be helpful in this discussion.
    Jim's answer is absolutely correct but I'm going to re-state for clarification.
    The i/p designation means you can chose to record as interlaced or progressive for a given resolution.
    It sounds like your camera is designed to "capture" images at 60 frames per second, selecting "native" mode means extra frames are deleted and only the desired frames, based on frame rate setting, are recorded to memory. The advantage of "native" @ 24fps is you save space on your memory card. The advantage of NOT using "native" mode is that all 60 frames per second are recorded, but the file metedata tells playback software to only show the frames needed for the specified frame rate (i.e. 24). Since all 60 frames per second are recorded, you use more memory but you also have the option of retrieving all the those frames, if you so desire, at a later time (i.e. for smoother slo-mo).
    To be honest I don't know what your spec of 1080i/24p means. If that is truly an option then I would guess it means it will record a 24p image but the metedata would indicate the file should playback at 30fps interlaced by adding the proper 3:2 pulldown. This would give you that "film" look in a broadcast compatible format.
    For the most part, you don't want use use any interlaced settings. Very few display devices still in use can properly display interlaced images. Interlacing is only required in some broadcast specifications.
    To answer the second part of your question;
    Frame rates are an indication of how many times the moving image is captured over a given period (per second). Higher frame rates means smoother, more "real life" motion. Data rates can generally be considered an indication of image or audio quality. Higher levels of compression result in lower data rates and (generally) lower quality. If squeezing more hours of footage on fewer memory cards is more important than getting the best image quality, choose a lower data rate. Higher frame rates (more images per second) inherently require a higher data rate to retain the same quality as fewer frames at a lower data rate.

  • Urgent help with quick translation questions

    Hello,
    I am somewhat new to Java. I have a translation to hand in in a few hours (French to English). Argh! I have questions on how I worded some parts of the translation (and also if I understood it right). Could you, great developers, please take a look and see if what I wrote makes sense? I've put *** around the words I wasn't sure about. If it sounds strange or is just plain wrong, please let know. I also separated two terms with a slash, when I was in doubt of which one was the best.
    Many thanks in advance.
    1) Tips- Always ***derive*** the exceptions java.lang.Exception and java.lang.RuntimeException.
    Since these exceptions have an excessively broad meaning, ***the calling layers will not know how to
    distinguish the message sent from the other exceptions that may also be passed to them.***
    2) The use of the finally block does not require a catch block. Therefore, exceptions may be passed back to the
    calling layers, while effectively freeing resources ***attributed*** locally
    3) TIPS- Declare the order for SQL ***statements/elements*** in the constant declaration section (private static final).
    Although this recommendation slightly hinders reading, it can have a significant impact on performance. In fact, since
    the layers of access to data are ***low level access***, their optimization may be readily felt from the user’s
    perspective.
    4) Use “inlining.”
    Inlining is a technique used by the Java compiler. Whenever possible, during compilation, the compiler
    copies the body of a method in place of its call, rather than executing a ***memory jump to the method***.
    In the example below, the "inline" code will run twice as fast as the ***method call***
    5)tips - ***Reset the references to large objects such as arrays to null.***
    Null in Java represents a reference which has not been ***set/established.*** After using a variable with a
    large size, it must be ***reassigned a null value.*** This allows the garbage collector to quickly ***recycle the
    memory allocated*** for the variable
    6) TIPS Limit the indexed access to arrays.
    Access to an array element is costly in terms of performance because it is necessary to invoke a verification
    that ***the index was not exceeded.***
    7) tips- Avoid the use of the “Double-Checked Locking” mechanism.
    This code does not always work in a multi-threaded environment. The run-time behavior ***even depends on
    compilers.*** Thus, use the following ***singleton implementation:***
    8) Presumably, this implementation is less efficient than the previous one, since it seems to perform ***a prior
    initialization (as opposed to an initialization on demand)***. In fact, at runtime, the initialization block of a
    (static) class is called when the keyword MonSingleton appears, whether there is a call to getInstance() or
    not. However, since ***this is a singleton***, any occurrence of the keyword will be immediately followed by a
    call to getInstance(). ***Prior or on demand initializations*** are therefore equivalent.
    If, however, a more complex initialization must take place during the actual call to getInstance, ***a standard
    synchronization mechanism may be implemented, subsequently:***
    9) Use the min and max values defined in the java.lang package classes that encapsulate the
    primitive numeric types.
    To compare an attribute or variable of primitive type integer or real (byte, short, int, long, float or double) to
    ***an extreme value of this type***, use the predefined constants and not the values themselves.
    Vera

    1) Tips- Always ***derive*** the exceptions java.lang.Exception and java.lang.RuntimeException.***inherit from***
    ***the calling layers will not know how to
    distinguish the message sent from the other exceptions that may also be passed to them.***That's OK.
    while effectively freeing resources ***attributed*** locally***allocated*** locally.
    3) TIPS- Declare the order for SQL ***statements/elements*** in the constant declaration section (private static final).***statements***, but go back to the author. There is no such thing as a 'constant declaration section' in Java.
    Although this recommendation slightly hinders reading, it can have a significant impact on performance. In fact, since
    the layers of access to data are ***low level access***, their optimization may be readily felt from the user’s
    perspective.Again refer to the author. This isn't true. It will make hardly any difference to the performance. It is more important from a style perspective.
    4) Use “inlining.”
    Inlining is a technique used by the Java compiler. Whenever possible, during compilation, the compiler
    copies the body of a method in place of its call, rather than executing a ***memory jump to the method***.
    In the example below, the "inline" code will run twice as fast as the ***method call***Refer to the author. This entire paragraph is completely untrue. There is no such thing as 'inlining' in Java, or rather there is no way to obey the instruction given to 'use it'. The compiler will or won't inline of its own accord, nothing you can do about it.
    5)tips - ***Reset the references to large objects such as arrays to null.***Correct, but refer to the author. This is generally considered bad practice, not good.
    Null in Java represents a reference which has not been ***set/established.******Initialized***
    After using a variable with a
    large size, it must be ***reassigned a null value.*** This allows the garbage collector to quickly ***recycle the
    memory allocated*** for the variableAgain refer author. Correct scoping of variables is a much better solution than this.
    ***the index was not exceeded.******the index was not out of range***
    The run-time behavior ***even depends on compilers.***Probably a correct translation but the statement is incorrect. Refer to the author. It does not depend on the compiler. It depends on the version of the JVM specification that is being adhered to by the implementation.
    Thus, use the following ***singleton implementation:***Correct.
    it seems to perform ***a prior initialization (as opposed to an initialization on demand)***.I would change 'prior' to 'automatic pre-'.
    ***this is a singleton***That's OK.
    ***Prior or on demand initializations***Change 'prior' to 'automatic'.
    ***a standard
    synchronization mechanism may be implemented, subsequently:***I think this is nonsense. I would need to see the entire paragraph.
    ***an extreme value of this type******this type's minimum or maximum values***
    I would say your author is more in need of a technical reviewer than a translator at this stage. There are far too serious technical errors in this short sample for comfort. The text isn't publishable as is.

  • Quick NativeWindow questions.

    Hi,
    Two Quick Questions about native window actions (I am using AIR with HTML and JS):
    1. How do you "refer" to minimize button ? - So, when a user clicks minimize, it should do an action defined in javascript.
    2. How to define click event for System tray icon ? - So I can display something when my system tray icon is double-clicked.
    Thanks.

    1. Add an event listener to the window.nativeWindow object, listening for the NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING  or DISPLAY_STATE_CHANGE events.
    2. Add an event listener to your SystemTrayIcon object. You can listen for click, mouseUp or mouseDown events, but doubleClick events are not dispatched by this object.

  • Quick REGEXP_LIKE Question

    Hi everyone,
    Had a very quick question: so I need to retrieve all records that have values in this format "type:123;target_id:456". Note that the numeric value can be 1-6 digits long for either type or target_id.
    Can someone please help me with the regexp_like-ing this?
    Thank you,
    Edited by: vi2167 on May 27, 2009 2:06 PM
    Edited by: vi2167 on May 27, 2009 2:07 PM

    WHERE REGEXP_LIKE(val,'type:\d{1,6};target_id:\d{1,6}')SY.

  • Quick beginner question about Applications folder

    I have a really simple basic question: Can I organize my computer's applications folder anyway I want? I don't want to move anything out of the apps folder but I do want to group my apps by a few different categories using folders. I don't see why this would be a problem but I wanted to be sure before I fouled anything up. (Time Machine will be nice).

    Create an Applications folder in your home folder and fill it with aliases to the real applications. You can organise these into sub-folders as you wish, without affecting the real applications. Moving the real applications can make updates fail. Different users can have different arrangements of applications.

  • Moving the ball

    public class Ball extends JFrame implements Runnable
         int x = 10;          
         int y = 100;     
         int radius = 20;     
         public Ballbewegung1()
              super("Ball Moving");
              setBackground (Color.blue);
              start();
              setSize(400,400);
              setVisible(true);
         public static void main(String[]args)
              Ballbewegung1 test = new Ballbewegung1();
              test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public void start ()
              Thread th = new Thread (this);
              th.start ();
              System.out.println("Start");
         public void run ()
              Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              while (x<=300)
                   x ++;
                   repaint();
                   try
                        Thread.sleep (20);
                   catch (InterruptedException ex)
                   Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
         public void paint (Graphics g)
              g.setColor  (Color.red);
              g.fillOval (x - radius, y - radius, 2 * radius, 2 * radius);
    }i not sure what wrong with my coding because it keep coming up the wrong out put.Any help will greatly appreciated. Thank you

    Maybe this code is your desired affect. This uses active render rather than depending the OS and java to repaint the screen. I prefer active rendering when possible. You can't use it if you have menu's or some other component that comes down into the painted area (or at least I haven't figured out how to solve the problem that when your component is painted it covers the menu...something java takes care of when using repaint()).
    Also, I went ahead a drew on your JFrame but as mentioned above it would be better to put a JPanel in the JFrame and draw on the JPanel. So basically create a class that extends JPanel and put this functionality in it and then add the JPanel to your top level JFrame. The flicker would go away if you drew on an off screen image and then moved it to the screen (at the end of the render method).
    The Timer method is the preferred method (rather than Thread.sleep) as the action it executes is executed form the Event Dispatcher Thread.
    Enjoy:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    public class Ball extends JFrame {
         private int x = 10;
         private int y = 100;
        private int radius = 20;
        private Timer animationTimer;
         public Ball() {
              super("Ball Moving");
              this.setSize(400,400);
              this.setVisible(true);
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            this.startAnimation();
         private void startAnimation() {
            Action animate = new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    render();
            this.animationTimer = new Timer(4, animate);
            this.animationTimer.start();
         private void render() {
            Graphics g = getGraphics();
            g.setColor(Color.blue);
            g.fillRect(0, 0, this.getSize().width, this.getSize().height);
              g.setColor(Color.red);
              g.fillOval(x - radius, y - radius, 2 * radius, 2 * radius);
            x = x + 1;
            if (x > 300) {
                this.animationTimer.stop();
        public static void main(String[]args) {
            new Ball();
    }

  • Okay quick easy question for all who have successfully uploaded videos

    hi, this is my first post in the Apple forums!
    my quick question:
    I have Quicktime Pro, and am currently exporting a video to the iPod
    but it is taking an unusually long time...
    is this normal (and by long I mean I'm @ 16% and it has been 5 minutes)
    do I just need to be more patient?
    thanks
    ^_^

    don't say that...
    I successfully uploaded videos to my iPod I just was not doing it right
    my question has been answered already so STOP BRINGING IT UP AGAIN
    also, look... many people just got their iPods today and are kinda anxious to see the video capibilities work on them, so If you do not have anything constructive to say (by calling us n00bs), then I suggest you don't say anything at all
    iPod video, Dell modded Windows XP Windows XP > your macs

  • Quick Easy Question About N580GTX-M2D15D5 Bios

    Hey guys!!
    I just have a real quick and easy (i suppose) question!
    I had bios version KH0, and MSI live update found KH1, i downloaded and flashed successfully (DOS window said please restart and press any key to exit) so i did, restarted my computer, and MSI live update utlity and gpu-z and MSI afterburner are all reporting the same bios version i had with the KH0, version 70.10.17.00.01 & date November 09, 2010
    MSI live update is not picking up the update again, so my question is, how do i know if it flashed correctly since the bios date and version remained the same?
    Thanks !

    Quote
    I had bios version KH0, and MSI live update found KH1, i downloaded and flashed successfully (DOS window said please restart and press any key to exit) so i did, restarted my computer, and MSI live update utlity and gpu-z and MSI afterburner are all reporting the same bios version i had with the KH0, version 70.10.17.00.01 & date November 09, 2010
    Quote
    version 70.10.17.00.01
    that's suppose to be, this is the version of the both bioses
    Quote
    & date November 09, 2010
    this is GPU release date, not BIOS date
    Quote
    MSI live update is not picking up the update again, so my question is, how do i know if it flashed correctly
    Get this: https://forum-en.msi.com/index.php?action=dlattach;topic=147603.0;attach=7931
    extract it somewhere, then run info1 , and look for the last line
    Quote
    since the bios date and version remained the same?
    they are not the same, your looking the wrong stuffs

  • TDMS - Quick winning Question....

    We are reviewing TDMS
    We have  one quick question ....
    After 4 years of Journey & age of landscpae, becuase of  SPDD & SPAU was not handled incidentally during "different" patch upgrades. and we assume there is slight inconsistency of " Repository objects"  " Dictionary Objects"...
    We want to acheive  In short
    We want to build a Development System which should be in synch of  " Repository objects"  " Dictionary Objects"... with out any master & application data with TDMS ?
    Can we acheive this or not ...
    TDMS provides all other luxuries, but we could get a straight confirmation as requirement as above.
    Pl Help
    Regards
    PR

    Hi Sriniwas
    If you are asking this question to make a buying decision about TDMS then i would suggest that you get in touch with your SAP customer engagement manager (account manager) and ask him to present you all the capabilities and functionalities of TDMS.
    Current version of TDMS offer multiple options and functionalities which may be useful for you.
    Now regarding the query that you have asked -
    If I understood you correctly you are looking for a functionality using which you want to create a development system which is a copy of your production system such that only repository gets copied over from production to the development system and all the client dependent application data is filtered. In the end you will have your development system which is in perfect sync as far as repository and DDIC is concerned.
    The above can certainly be achieved using the TDMS Shell process within TDMS. TDMS Shell is also used as a process to prepare your receiver system for TDMS data transfer.
    I hope this info helps
    Pankaj.

  • Quick naming question

    Wasnt sure if its a naming issue or not but Ive never ran into the problem and Im not sure how to describe it....so here goes.
    Question: Is there a way to insert a string into the name of a component name and have java see it as the actual component name. (see that question still sounds incorrect)
    What I mean is......
    you have 10 buttons named oneB, twoB, threeB,......tenB
    I need to either change a whole lot of code and make what I want to be simple, very large and complex or, find a way to....
    "one"B.setLocation(whereverNotImportant);
    or
    (someObject.getString( ) ) + B.setLocation(whereverNotImportant);
    It looks really odd to me. If theres a way to do it, it just saved me a lot of annoyance.....if not well, Im gonna need more energy drinks.

    Paul5000 wrote:
    Fair enough. I kept adding features onto the code and it grew into needing something different. Was just hoping there was a quick workaround so I didnt have to go back and recode half of it.When you've got Franken-code, the answer is to recode it.

Maybe you are looking for

  • Does 7.0.6 update break sync with iPhoto 9.2.3?

    Recently got an iPad mini with retina display (about 4 weeks ago). It had iOS 7.0.4. I did not have any problems connecting to iPhoto. I installed iOS 7.0.6 to address the SSL bug issue. Now, when I plug the iPad into my Macbook Pro running 10.6.8/iP

  • N85 Music player problem

    Hi Appreciate your help here. I've loaded quite a few albums to my N85 using Win media player 11. The problem is that some tracked in some albums appear twice!! If I do nothing they also play twice. If I erase one of the double tracks the other one g

  • SERVICE ORDER COST IS NOT FLOWING TO CONDITION TYPE EK01 IN SALES ORDER

    hi all, My requirement is that the cost incurred in service order should flow to the condition type ek01. we will be running the transaction dp90 to calculate the cost for the resources used. the cost are getting calculated at service order level but

  • Why can't you buy a nano 6th gen on apple website?

    Now that the new generation of iPod nano's have come out, you can't buy the previous 6th generation anymore, you can still buy previous generations of iPhone etc and MacBooks but not the nano's. How can you get free engraving on the iPod nano 6th gen

  • Font quality in charts

    When creating a chart and applying fonts style, I noticed that the quality of the image returned by the IGS is really poor. All the fonts are "blurry" and are not as nice as in the tables. We applied all the related notes and all used fonts are insta