Is this a bug or a simple Newbie mistake?

Hi.
I'm brand new to JavaFX, so I'm probably misunderstanding something. I've searched the web looking for information concerning it, but since it involves the 'new' operator, it's hard to filter down.
Anyhow, here is the problem:
I'm getting different results when I instantiate an object
using the 'new' operator vs. the declaring it the more
accepted JavaFX way.
This is how I found the "problem".
In order to learn how to program in JavaFX, I found a simple game from the Internet, "Blasteroids", to look at (http://www.remwebdevelopment.com/dev/a41/Programming-Games-in-JavaFX-Part-1.html). I copied and pasted this into:
NetBeans IDE 6.9 (Build 201006101454)
JavaFX 1.3 and got the game to work.
In playing around with it, I converted instantiating an object from the "normal" way:
    var a: Asteroid = Asteroid
        type: type
        posX: x
        posY: y
        moveAngle: moveAngle
        velocityX: Math.sin(Math.toRadians(moveAngle))
            * randomVelocity
        velocityY: -Math.cos(Math.toRadians(moveAngle))
            * randomVelocity
        rotation_increment: rotation_increment
        active: true;
        return a;To using the "new" operator:
        var a:Asteroid = new Asteroid();
        a.type = type;
        a.posX = x;
        a.posY = y;
        a.moveAngle = moveAngle;
        a.velocityX = Math.sin(Math.toRadians(moveAngle)) * randomVelocity;
        a.velocityY = -Math.cos(Math.toRadians(moveAngle))* randomVelocity;
        a.rotation_increment = rotation_increment;
        a.active = true;
        return a;This is the only changes I made. I would "toggle" back and forth between the two, and I would always get the same results.
When I did this conversion, the ship would show up, but the asteroids were gone. Actually, I think they were invisible because every once and a while, my ship would "blow up" and get reset to it's starting position. I tried adding:
a.visible = true;
But that didn't help.
Indecently, I did the same thing with defining the "Stage" using a new operator, and got differing results:
1. the window would open in the bottom right of my screen (vs filling up
most of my screen. I would have to drag it up to play.
2. it had a regular windows border with the minimize, maximize, close
buttons in the top right (vs. a non-movable, border less window with no
maximize, minimize, close buttons.)
Is this a bug, or am I doing something wrong?
Thank you

I suspect you've run into bugs in the Blasteroids program and possibly in Stage in the JavaFX runtime.
For simple cases one would think there should be no difference between this:
var so = SomeObject {
    a: 1
    b: 2
    c: 3
}and this:
var so = SomeObject { }; // or var so = new SomeObject();
so.a = 1;
so.b = 2;
so.c = 3;However, these cases do run through different code paths. In the first case, the init-block of SomeObject sees all the values provided by the caller. In the second case, the triggers on the a, b, and c variables would have to modify the internal state of the object appropriately. If the object has a lot of complex state, the result at the end of setting the three variables (and running their triggers) might not be identical to the object literal after initialization. This is most likely a bug. If an object isn't prepared to have its state variables modified after initialization, it should make them public-init instead of public.
Depending on the object, though, initializing things via an object literal vs. setting variables after initialization might actually have different semantics. This seems to be the case with Stage. The Stage's size is established by its contents at initialization time, and its location at initialization time is determined by using its contents' size and the screen size to center the Stage on the screen. If you create the Stage empty, and then later add contents, the sizing/centering calculations will be based on an empty Stage and will thus give a different result.
Using the object literal technique is idiomatic JavaFX Script, and it's probably more efficient than setting variables after initialization, so I'd recommend sticking with object literals.

Similar Messages

  • Is this a bug of Outlook 2007 about images displaying in signature?

    I've done many tests and researched on website or MS KB. But still got no solution.
    My issue is:
    I make a signature with images linking from website which can be easily accessed.
    I setup this signature in Outlook 2007, when I compose a new mail, and choose the signature I set. It won't show the images with a high percentage rate, meanwhile, I try to get into "Signature"-"Signature...", 
    Outlook2007 gets stuck, then you can not close Outlook or open Internet Explorer unless you kill the process of OUTLOOK.exe.
    1. Test are done under a clean XP system and Office 2007 standard fresh installed. Also there are some other staffs who help me test the signature that report the same issue on Office 2007.
    2. Images are rendered in 96dpi. They are all in very small size stored on website, can be easily accessed without network connctivity problem.
    3. The signature is made by simple HTML language not by Outlook signature setup wizard. but in this case,  you can ignore which method I use to create the signature. The images in signature can be displayed well in Outlook 2003 &
    2010. Also I have tried insert images using "link to file" in Outlook signature setup wizard, got same issue.
    4. Don't suggest me to store the images locally. These images should be updated after a period. You can not ask the company staffs to update these images manually by themselves. and even if the images are stored locally, the images won't be shown
    in Outlook 2007 with a high percentage rate.
    5. I've tried setup signature with or without an account profile, got same issue.
    6. I 've tried without an accout profile, just copy the signature file to Outlook signature folder, unplug the network cable, and "new mail" then load the signature, of course, the images won't be shown because network connection doesn't exist,
    and then when I try to get into "Signature"-"Signature...",  the Outlook interface also gets stuck. So I think Outlook 2007 may have some problem on detecting the network connectivity.
    7. It is not possible to upgrate the version of Office. Since Office 2007 isn't out of date and is powerful enough for us, no one want to pay more money just to avoid this issue.
    I don't know why I cannot upload a screenshot for troubleshooting. If needed. I can send a mail with screenshot attached.
    So far to now, I still get no solution, I think this is a bug of Outlook 2007, because the same signature, there is no problem on Outlook 2003 & 2010. Hope someone of MS staff can see this article and report to technical support center.
    I would appriciate anyone's kindly help but please consider that you understand what I am talking about. I don't want to waste time for each of us.
    thanks in advanced.

    What kind of problem about the display image in signature?
    How do you add the image into the message body when you send the message?
    Does it show correct through Web-based access?
    Outlook 2007 doesn't support some of Style Element, you may reference the link as below:
    http://www.campaignmonitor.com/css/
    Thanks.
    Tony Chen
    TechNet Community Support
    Thanks for your reply,  I know that some Style Elements won't be supported in Outlook, but this is not the reason.
    Please refer to my post previously, I post it but get no response.
    http://social.technet.microsoft.com/Forums/office/en-US/481170b1-f23f-4d46-9914-823326491846/is-this-a-bug-of-outlook-2007-about-images-displaying-in-signature?forum=outlook

  • Is this a bug in APEX or I'm missing something

    Hi,
    I have a table chr10bug( id number , sample_text varchar2(4000)).
    I am using simple form with textarea to populate sample_text.
    I have a report based on above table.
    The report query is select id , sample_text from chr10bug. The Link tab has Target as URL. URL is javascript:void(0); and Link attribute has a very simple function
    onmouseover="alter('#SAMPLE_TEXT#')"
    Now, my question is when a user hits enter in the textarea eg.
    User enter some text **User Press Enter**
    User enter some text again
    In the reports the onmouseover="alert('#SAMPLE_TEXT#')" does not work for recrod where users pressed enter key. (In fact none of the function which accept string is working) . If we do not press enter while entering data in textarea... the above function is working...
    Example is here....
    http://apex.oracle.com/pls/apex/f?p=32555:1 ( report)
    http://apex.oracle.com/pls/apex/f?p=32555:2 ( form to enter data via text area)
    Is this a bug...
    Regards,
    Shijesh
    Edited by: Apex_Noob on Nov 18, 2010 12:18 PM

    Hi,
    Thanks once again for reply.
    I create two report with same javascript function alert('#sample_text#')
    CASE1 >> Javascript function call is placed in Link attribute section as ** onmouseover="alert('#sample_text#')" >>> This is not working
    CASE2 >> Javascript function call is place in URL section as ** javascript:alert('#sample_text#') >>>> This is working however I'm not able to have onmouseover feature.
    Any alternative to have onmouseover=myFunction('#COLUMN_NAME#').
    http://apex.oracle.com/pls/apex/f?p=32555:1:8742069995710311:::::
    thanks,
    Shijesh
    Edited by: Apex_Noob on Nov 18, 2010 12:45 PM

  • Is this a bug or a "security feature" ?

    I had a nagging bug in coldfusion where every once in a while
    when people entered text and I inserted it into an MS SQL database
    it would throw the error "Statement is not allowed." I got a clue
    when a customer put in the words drop and program in their
    description for something, when I took the words out it worked
    fine. I gave the datasource permission to grant, revoke, drop, ect
    ect in the advanced datasource options and poof, it works! So is
    this a bug or some kind of injection attack prevention? The text
    was actually formatted in an FCK editor and put within single
    quotes in an UPDATE statement.

    chazman113 wrote:
    > I had a nagging bug in coldfusion where every once in a
    while when people
    > entered text and I inserted it into an MS SQL database
    it would throw the error
    > "Statement is not allowed." I got a clue when a customer
    put in the words drop
    > and program in their description for something, when I
    took the words out it
    > worked fine. I gave the datasource permission to grant,
    revoke, drop, ect ect
    > in the advanced datasource options and poof, it works!
    So is this a bug or some
    > kind of injection attack prevention? The text was
    actually formatted in an FCK
    > editor and put within single quotes in an UPDATE
    statement.
    >
    It is not a bug, and you have definitely disabled a lot of
    security by
    opening up your DSN like that. It helps to look at this how
    each of
    various systems look at it.
    On the ColdFusion end, it is just working with strings. The
    security
    settings in the administrator are basically string searches.
    I.E.
    Don't allow these problematic sub-strings in the SQL string.
    Anyone who
    has worked with more then the most basic string manipulation
    understands
    how convoluted it quickly becomes and how nigh impossible it
    is to make
    up a foolproof rule.
    Once the database receives the query string, it tokenizes
    what it
    receives and starts processing the commands. If one just uses
    <cfquery...> than everything is received as one long
    string and the
    database must make it's best attempt to determine which parts
    of the
    strings are commands and which parts are parameters and which
    parts are
    data. It is relatively easy to confuse the database in this
    process so
    that information meant to be data is processed as a command.
    This is
    the essence of a SQL injection attack.
    If one uses the <cfqueryparam...> tag or stored
    procedures, the
    developer more explicitly defines which parts of the SQL is
    commands and
    which part is data. Now the database knows what part of the
    SQL is data
    and it does not even try to tokenize it for commands.
    Thus the simpler and more secure solution to your original
    problem would
    be to use <cfqueryparam...> for these fields that could
    potentially and
    legitimately contain strings that could look like SQL
    commands so that
    the database would know to not even look there. Generally its
    a best
    practice to always use <cfqueryparam...> tags in your
    ColdFusion SQL.

  • I did not forget my lock code but somehow, my phone refuses to accept it and kept me locked out. Is this iOS7 bug?

    i did not forget my lock code but somehow, my phone refuses to accept it and kept me locked out. Is this iOS7 bug?

    i honestly do not know. this is really frustrating. I am a simple user who mostly just call and text..  i tried to follow the apple instructions in restoring iphones but some time during the process.. my phone restarts and loses the itunes connection symbol and displays the usual apple icon and then proceeds to opening the main page..

  • [svn] 3246: Fix fasttrack bug SDK-16910 - Simple List populated with strings throws RTE .

    Revision: 3246
    Author: [email protected]
    Date: 2008-09-17 15:31:25 -0700 (Wed, 17 Sep 2008)
    Log Message:
    Fix fasttrack bug SDK-16910 - Simple List populated with strings throws RTE. This is fallout from the Group/DataGroup split. DefaultItemRenderer now uses a TextBox instead of a Group to show the list data.
    QE: Any List tests that depended on the default item renderer to support anything other than text must be updated.
    Bugs: SDK-16910
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16910
    http://bugs.adobe.com/jira/browse/SDK-16910
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/DefaultItemRenderer.mxml

    BTW, I do not experience the bug you had mentioned at
    http://www.cs.rit.edu/~cxb0025/flex/TreeControlBugs.html
    Can submit a video of my actions recorded

  • Why can't i edit my project in imovie anymore??  (over 1 hr long) - is this a bug ?

    why can't i edit my project in imovie anymore??  (over 1 hr long) - is this a bug ?

    Hi
    There is a limiting factor that's easy to miss.
    • FREE SPACE on Start-Up (Mac OS) Hard Disk
    When this goes low then iMovie, Mac OS and all applications runs into problems. So to get a safe way to work (for me) I set a minimum that I try to never go lower than. (Sorry for strange sentence)
    I never let my Mac (Macintosh HD) go lower than 25GB free space. If it does - then I move away things to an external hard disk (always Mac OS Extended (hfs) formatted - as nothing else will do for VIDEO)
    Else - in iDVD Time is the limiting factor. (iMovie - I never run into any - my monster Vacation epos is >>6 hours)
    iDVD 08, 09 & 11 has three levels of qualities. (version 7.0.1, 7,0.4 & 7.1.1) and iDVD 6 has the two last ones
    • Professional Quality
    (movies + menus up to 120 min.) - BEST (but not always for short movies e.g. up to 45 minutes in total)
    • Best Performances
    (movies + menus less than 60 min.) - High quality on final DVD (Can be best for short movies)
    • High Quality (in iDVD08 or 09) / Best Quality (in iDVD6)
    (movies + menus up to 120 min.) - slightly lower quality than above
    Menu can take 15 minutes or even more - I use a very simple one with no audio or animation like ”Brushed Metal” in old Themes.
    About double on DL DVDs.
    Yours Bengt W

  • Is this a bug on sp4?

    Hi all!
              I'm testing WLS5.1sp4; I encounter a strange behavior; I've developed a
              simple servlet that write a simple string on browser window.
              When I run it in a non-clustered environment it works fine;
              in clustered environment (WLS5.1 sp4 as proxy and 2 WLS5.1sp4 in cluster)
              servlet respond with an infinitive loop of HTML code as follow:
              <html>
              <head><title>WithoutSession</title></head>
              <body>WithoutSession
              </body></html>
              <html>
              <head><title>WithoutSession</title></head>
              <body>WithoutSession
              </body></html>
              <html>
              <head><title>WithoutSession</title></head>
              <body>WithoutSession
              </body></html>
              <html>
              <head><title>WithoutSession</title></head>
              <body>WithoutSession
              </body></html>
              <html>
              <head><title>WithoutSession</title></head>
              <body>WithoutSession
              </body></html>
              and so on.
              Is this a bug for sp4 or am I wrong in something?
              Thanks in advance.
              

    Francis,
    What type of data are you trying to insert? Are you working with BLOBs?
    - Junius

  • Pages 5.5.1: When opening a document created with Pages '09 (Version 4.0) with Pages 5.5.1 the page header and the page footer are deleted. How can this be prevented? Or is this a bug in Pages 5.5.1?

    Pages 5.5.1: When opening a document created with Pages '09 (Version 4.0) with Pages 5.5.1 the page header and the page footer are deleted. How can this be prevented? Or is this a bug in Pages 5.5.1?

    Same problem here (no graphics in header or footer) and the problem has been reported months ago. It is another bug/feature lost when Apple moves from 09 to the iCloud-compatible versions.  Complain to Apple, you may have better chance than me and they may finally listen to their users....

  • Is this a bug in OWB 11.2 - importing table metadata for character columns

    The Oracle® Warehouse Builder Data Modeling, ETL, and Data Quality Guide provides an overview of the data types supported.
    http://docs.oracle.com/cd/E11882_01/owb.112/e10935/orcl_data_objx.htm
    It says that for VARCHAR2 data type it saws (http://docs.oracle.com/cd/E11882_01/owb.112/e10935/orcl_data_objx.htm#CHDFIADI )
    "Stores variable-length character data. How the data is represented internally depends on the database character set. The VARCHAR2 data type takes a required parameter that specifies a maximum size up to 4,000 characters"
    That means , I guess, it says that when I import a table, any columns of type VARCHAR2(10) in the database should have its length show as characters in OWB, so a column of type Varchar2(10) in the Oracle database, should be shown as Varchar2(10) when imported into OWB table metadata via the OWB import function.
    However, if I have a database that set-up as a single-byte and import a table using the OWB import function a column that has a size of e.g. 10 in the database, is imported as OWB table metadata and the size is 10. Correct, I am happy.
    However, if the database is modified to support multi-byte characters, ALTUF16 encoding with the semantics set to "CHAR", then when I import the same table into OWB, OWB reports the size as 40, I guess its 40 bytes as in 10 characters @ 4 bytes per character.
    Is this a bug in OWB, as the datatype in the Oracle DB is varchar2(10), should OWB after importing a table not also report the column as VARCHAR2(10) ? Currently, is shows the column as varchar2(40).

    I noticed that myself in our project.
    Our varchars2 are defined as VARCHAR2(xxx CHAR) - OWB puts the size*4
    In fact if you have special characters like umlauts (ü,ä,ö,...) it will use 4 bytes per character.
    You can try it yourself. Define a Varchar2(1 CHAR) and manually change the size of the Column in your mapping inside OWB (in filters, joins or your target table).
    Then shoot an umlaut through the mapping and will end up with a "too small" error.
    Dont mind the size*4 issue - we totally ignored it and run without error since 4 years now.

  • I can't open my imovie '9 projects on my new lap top which uses imovie 11'.. previous lap top was mac book osx 10.5.8.. new one is mac book pro 10.6.6.. any help out there! i'm pretty useless at this stuff, might be really simple???

    which uses imovie 11'.. previous lap top was mac book osx 10.5.8.. new one is mac book pro 10.6.6.. any help out there! i'm pretty useless at this stuff, might be really simple???

    Thanks for nothing, as usual, Apple.
    I had to redo the whole project from scratch on Windows Movie Maker.
    Now I know which brand to trust on my next purchase.

  • Iphone 6 tells me that "Item not available" in my country UK, when i click on the itunes store icon for the app to open the music, movies or tv shows section of the app. is this a bug?

    I am based in the UK and have just got a new iphone 6, everything works well except when i try to turn on the itunes store app -  i can do a search and buy music etc that way, within the app, however, if i go to Music, Movies or the TV shows section within the Store app, i get a message come up saying "Item Not Available" - This item you've requested is not currently available in the UK Store, but it is available in the US store. Tap Change Store to view this item".   I therefore cannot browse the music, movies or tv shows sections at all, nothing shows up except that message.  All my previous itunes purchases have downloaded ok, and i can access them. My apple ID works fine and restrictions on the iphone are turned OFF. The App Store app works normally. Connection etc is all fine and I can access itunes  in the normal way on my ipad and laptop, so this is just an iphone problem. Any ideas? is this a bug? I cant find anyone else with exactly the same problem. By the way, the same message comes up when i click on the red Music icon, on the iphone (situated next to the Safari icon) and then go to the "Store" via that app.  my playlists are in tact, but as soon as i click that Store button, I am told that the Item is unavailable - not that i have chosen any Item lol, I just want to access the store in the normal way. Thank you in advance for any suggestions you can give

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

  • Open Cursor Issue because of file browse Item - Is this a Bug in APEX 3.2

    Hi All,
    I am using file browse Item to upload file into the database at two places in my application, but it seems whenever I am submitting those two pages, with file path or without file path, its opening an cursor which remains open after that, because of this open cursor count in the application is getting exceeding every time.
    For testing this I have made an dummy page containing just file browse item and submit button, and still it is increasing the open cursor count.
    Is this a bug in Apex file browse item or there is some other way to handle this.
    Please kindly help me in the above issue as this is affecting the production application.
    Thanks & Regards
    Sanjay
    Edited by: user11204334 on Dec 5, 2010 9:57 PM
    Edited by: user11204334 on Dec 5, 2010 9:58 PM

    Hi,
    One observation, Apex is switching the Session ID after one got killed ? I was working on Apex page with browse Item to test open cursor count,
    after killing the SID (227) on which the open cursor count was getting increase, it APEX automatically switches to new SID(149) for that session.
    Now the problem is even if I have two SID's and one hits the maximum open cursor count, It is not switching to other SID instead the whole application becomes unavailable.
    STATNAME SID VALUE USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 74 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 227 325 APEX_PUBLIC_USER Killed
    opened cursors current 244 15 APEX_PUBLIC_USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 76 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 244 15 APEX_PUBLIC_USER
    Please kindly help in this.
    Thanks in Advance
    Thanks & Regards
    Sanjay
    Edited by: user11204334 on Dec 8, 2010 1:02 AM

  • Is this a bug with BoEdge3.1?

    Can anyone help me on the issue which my customer is facing for BoEdge3.1
    Concerning  Error Message: You do not have enough Named User Licenses to make this user a named user. You have 55 Named User Licenses. (FWB 00013)
    This is the error message she was receiving when trying to change an
    existing user from Concurrent to Named under the Connection Type on the
    Properties panel.
    The current workaround was to delete the existing Concurrent user, then re-add the same user as Named.
    She have been going through this process of deleting existing users, and then
    re-adding them as Named and it was working okay. Then, it stopped
    working and she started getting the same FWB 00013 error message again.
    She was not able to create any Named users now. Basically, the workaround
    worked for a while - then stopped working.
    She currently has a total of 88 users. 21 of them are named. 67 of them
    are Concurrent. She is licensed for 55 Named.
    Once again, the system thinks she has 55 users marked as Named. But
    there are only 21 marked as Named.
    She did notice that as she was going through all of her existing list of
    users, in alphabetical order, she was opening the Properties tab and
    checking the Named/Concurrent status - as she got to the 55th user in the
    list that is when she started getting the error message again.
    Is this a bug with BoEdge3.1?
    And I got an ADAPT01194692.
    I am not sure that Is the ADAPT related to this issue.
    Please help me its very critical.

    Hi Salena,
    If you are an SAP Employee, request you to post this question at
    https://cw.sdn.sap.com/community/bobjtc
    Cheers,
    Subhodeep

  • JDev 9.0.3, Business comp wizard, is this a bug?

    Howdy,
    Found something that perhaps is a bug, hoping you guys have fixed for the real release.
    1) Create a database connection, but don't fill in username/password. Don't check deploy password.
    2) Create new workspace and project.
    3) create new business component package in the project. On step 2, point Connection name to username/password-less connection. Alert says prompt will ask for credentials. No matter what I put in, with valid username/password entries, a Connect Error pops saying invalid arguments in call. Exception: oracle.jdeveloper.cm.CMException.
    Is this a bug? We're using dynamic credentials in our app with data sources, so username/password is left off.
    Thanks,
    Joe Tseng
    Technical Management Consultant
    TUSC
    [email protected]

    Joe,
    I've filed Bug#2561459 to track this problem.

Maybe you are looking for

  • My IPad keeps using my old Apple ID to try to access iCloud.

    Hey My Ipad shows the correct ID in the ITunes Store Settings but when I try to access iCloud my old email pops up as my Apple ID. I can't delete it and type in the correct one, and I can't sign in undet that email bexause it no longer exists, I don'

  • Create warning message at the time of order creation

    I am looking for a  solution :- "Create warning message at the time of order creation/save if a cc is assigned in the settlement rule that crosses the company code of the order or where the company code of the plant for the order is different from th

  • Getting error while try to send data to matmas05 idoc

    hello frnds, i m working on a scenario in which i m sending data from xml file to matmas05 idoc of R/3. here i have done all the required XI settings. at sender side i have used file adapter and at reciever side IDOC Adapter. while i m executing my s

  • Can I use a UAE Visa card on a US apple ID ?

    It's really bothering me that I can't really use much of the iTunes on the UAE store :(

  • Solaris 8 installation Error

    Dear Sir or Madam My system: * Intel 450, Sony ( CD -Rom and burner ) connect to primary IDE1 on mother board * Creative DVD rom connect to IDE 2 through ATA 100 card; * 80 G Western Didigtal connect to IDE1 through same ATA 100 card above. * Bios lo