Graphics.drawLine and Graphics.drawRect do not match

Using a Graphics.scale (not == 1.0, but the value is insignificant) often Graphics.drawLine and Graphics.drawRect do not match (with same and x and y-Values), there are differences of one pixel in x- and y-direction when you use JDK 1.6_Update12 and later in about every third rectangle. The values in the code sample are not significant for getting the problem.
I am using Windows XP and can get the error with JDK 1.6 Update 12 until JDK 1.6 Update 16, but not with the earlier updates.
Could this be considered an Java error ?
public class LbCanvas extends Canvas
   Image scratchPad = null;
   Graphics scratchPadGraphics;
   double small = 0.99;
   public LbCanvas()
      setSize (new Dimension (1354, 1397));
   public void update(Graphics g)
      if (scratchPad==null)
         scratchPad = createImage (this.getSize().width, this.getSize().height);
      scratchPadGraphics = scratchPad.getGraphics();
      paint(scratchPadGraphics);
      g.drawImage (scratchPad, 0, 0, null);
   public void paint(Graphics g)
      super.paint(g);
      ((Graphics2D)g).scale (small, small);
      g.setColor(Color.black);
      for (int i=30; i<900; i+=31)
         g.drawRect (10, i, 150, 21);
         g.drawLine (10, i, 160, i);
}Edited by: Mausboesie on Oct 1, 2009 2:25 AM

I tried your code with various scalings--it seems some are better than others. It looks, without checking the implementation, that the problem is in how each andles the scaling and I would definetly consider this a "Java Error".

Similar Messages

  • Sample rate off the audio input and out devices do not match - what to do?

    This is fundamental, I know, but nevertheless I can't find my way around it. I get this error message when trying to recor:
    Sample rate off the audio input and out devices do not match
    and am asked to do this:
    Use the appropriate operating system or audio device control panel to adjust the sample rates of the input and output devices to use the same settingt.
    I have defined the sample rate to 44.1/16 bit in accordance with my inbuild soundcardt.
    I am trying to record from LineIn.
    When running on a M-Audio sound card I don't face any problems.
    HP 8560W, sound card IDT/High definition audio Codec
    Any suggestions?
    Knud
    Copenhagen

    You're sure you have set BOTH the input and output settings to 44.1 16 bit?
    Which version of Windows are you running?  There are a number of posts on this forum about how to fully access both the Windows Mixer and the Mixer for your soundcard.  Especially, you need to ensure that all "Windows Sounds" are turned OFF.

  • Regarding : Material document data and PO data do not match (Plant)

    Hi Gurus,
    Please go through this BAPI program.
    While uploading it is giving an error ' Material document data and PO data do not match (Plant) '.
    Please help regarding this issue.For all Other moment types it is working fine except this 351 moment type.
    dATA: i_excel TYPE truxs_t_text_data. "work table for excel upload
    DATA: BEGIN OF it_itab OCCURS 100,
          docdate(10),
          postdate(10),
          mvt_type(3), "Movement Type
          plant(4), "Plant
          lgort(4),
          pur_doc(10), "Purchase Document No
          po_item(3), "Purchase Document Item No
          material(18), "Material Number
         delnote(16),
          erfmg(13),
          uom(3),
         lfmng(13), "Quantity
          batch(10) TYPE c,
          vfdat TYPE vfdat,
          END OF it_itab.
    DATA: it_goodsmvt_head TYPE TABLE OF bapi2017_gm_head_01      INITIAL SIZE 100,
          it_goodsmvt_code TYPE TABLE OF bapi2017_gm_code         INITIAL SIZE 100,
          it_goodsmvt_item TYPE TABLE OF bapi2017_gm_item_create  INITIAL SIZE 100.
    DATA: wa_goodsmvt_head LIKE LINE OF it_goodsmvt_head,
          wa_goodsmvt_code LIKE LINE OF it_goodsmvt_code,
          wa_goodsmvt_item LIKE LINE OF it_goodsmvt_item.
    DATA: w_mat_doc  TYPE bapi2017_gm_head_ret-mat_doc,
          w_year     TYPE bapi2017_gm_head_ret-doc_year.
    DATA: BEGIN OF it_errmsg_goodsmvt OCCURS 10.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF it_errmsg_goodsmvt.
    DATA : obj_type LIKE bapiache09-obj_type,
           obj_key  LIKE bapiache09-obj_key,
           obj_sys  LIKE bapiache09-obj_sys.
    DATA: v_date1 TYPE sy-datum.
    DATA: v_date2 TYPE sy-datum.
    DATA: w_lines TYPE i.
    DATA: errflag.
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-100.
    PARAMETERS: p_file TYPE  rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK bk1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    Start-of-selection processing
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header        = 'X'
          i_tab_raw_data       = i_excel
          i_filename           = p_file
        TABLES
          i_tab_converted_data = it_itab[]
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT it_itab.
        REFRESH it_goodsmvt_head.
        REFRESH it_goodsmvt_item.
        CONCATENATE it_itab-docdate6(4) it_itab-docdate3(2) it_itab-docdate+0(2) INTO v_date1.
        CONCATENATE it_itab-postdate6(4) it_itab-postdate3(2) it_itab-postdate+0(2) INTO v_date2.
        wa_goodsmvt_head-pstng_date = v_date2.
        wa_goodsmvt_head-doc_date   = v_date1.
       wa_goodsmvt_head-ref_doc_no = it_itab-delnote.
    wa_goodsmvt_head-pr_uname   = sy-uname.
        APPEND wa_goodsmvt_head TO it_goodsmvt_head.
    Maintain it_goodsmvt_code
        wa_goodsmvt_code-gm_code    = '04'.
    Maintain it_goodsmvt_item
    *LOOP AT it_itab.
    IF wa_goodsmvt_item-po_number IS INITIAL.
        wa_goodsmvt_item-po_number    = it_itab-pur_doc.
        wa_goodsmvt_item-move_type    = it_itab-mvt_type.
        wa_goodsmvt_item-MOVE_PLANT      = it_itab-plant.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = it_itab-material
          IMPORTING
            output = it_itab-material.
        wa_goodsmvt_item-material     = it_itab-material.
        wa_goodsmvt_item-stge_loc     = it_itab-lgort.
        wa_goodsmvt_item-po_item      = it_itab-po_item.
        wa_goodsmvt_item-entry_qnt    = it_itab-erfmg.
        wa_goodsmvt_item-ENTRY_UOM_ISO    = it_itab-uom.
       wa_goodsmvt_item-po_pr_qnt    = it_itab-lfmng.
        wa_goodsmvt_item-batch        = it_itab-batch.
        wa_goodsmvt_item-expirydate   = it_itab-vfdat.
       wa_goodsmvt_item-NO_MORE_GR   = 'X'.
        wa_goodsmvt_item-mvt_ind      = 'B'.
        APPEND wa_goodsmvt_item TO it_goodsmvt_item.
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header  = wa_goodsmvt_head
            goodsmvt_code    = wa_goodsmvt_code
          IMPORTING
            materialdocument = w_mat_doc
          TABLES
            goodsmvt_item    = it_goodsmvt_item
            return           = it_errmsg_goodsmvt.
    Process of commit work
        IF it_goodsmvt_head[] IS NOT INITIAL.
          DESCRIBE TABLE it_goodsmvt_head LINES w_lines.
        ENDIF.
        IF it_goodsmvt_item[] IS NOT INITIAL.
          DESCRIBE TABLE it_goodsmvt_item LINES w_lines.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = 'X'.
        IMPORTING
        RETURN        =
          CLEAR errflag.
          READ TABLE it_errmsg_goodsmvt INDEX 1.
          IF it_errmsg_goodsmvt-type EQ 'E'.
            WRITE:/'Error in function', it_errmsg_goodsmvt-message.
            errflag = 'X'.
          ELSE.
            WRITE:/ it_errmsg_goodsmvt-message.
          ENDIF.
          IF errflag IS INITIAL.
            COMMIT WORK AND WAIT.
            IF sy-subrc NE 0.
              WRITE:/ 'Error in updating'.
              EXIT.
            ELSE.
              WRITE:/ 'Material Document created successfully and the Document Number for the Material',
                      wa_goodsmvt_item-material,'is:', w_mat_doc, w_year.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.

    Hey,
    Just wanted to post that in my case this was the error of MVT_IND field in item table. When I made it from 'B' to blank then it worked.
    Mine is solved....
    Thanks

  • Aging report and Control account value not matching

    Hi All
    The value what i am getting from   Vendor liabilities aging and Control account is not matching  for the same dates, all my parameters or selection criteria are same
    Same report if i am taking for the current date it giving correctly,
    If i am trying for a previous day the problem is happening
    How can i solve this issue

    Hi,
    Please check if the transactions are done for different Control Accounts and both the account balances are included in the Aging Report.
    Also, check that ALL the customers/vendor groups are taken.
    Make sure that you are running the backdated aging with the checkbox as mentioned in the Note 800294.
    If still facing problems may be you can provide with more details as to what the control account balances and what is the Aging, difference.
    PS: Check if there is any manual journal entry is created in the control account?
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Status 51 material document data and po data do not match(vendor)

    i am using we19 to try an inbound idoc mbgmcr(receipt for po)
    i put in gm_code 01
    movement indicator B(goods receipt for po)
    vendor 3815
    PO 4500015241
    PO Order Item 00030
    Movement type 101
    qty in unit of entry  1
    iso code unit of measurement pc
    on the po screen i see the po item and qty to be delivered is 75
    when i run the inbound idoc i get
    status 51 material document data and po data do not match(vendor) but as i say on the po inquiry screen i see the po vendor item with 75 to be delivered
    what am i missing????????????????

    thank you
    i put in the leading zeros and got rid of that problem
    now i am getting status 51
    posting only possible in 2004/07 and 2004/06
    but in the posting date i use 07/02/2004  i have tried several dates in the period but get the same error
    any ideas?
    thanks you

  • Shuffle play no longer works properly and the artwork does not match after iOS5 upgrade.

    When I use shuffle play, my ipod touch stops playing after one or two songs and the artwork does not match the song. 

    i have what sounds like the exact problem; thought it might be related to a) my recent replacement phone, or b) my recent upgrade to OS 5.0.1

  • Oracle Streams 'ORA-25215: user_data type and queue type do not match'

    I am trying replication between two databases (10.2.0.3) using Oracle Streams.
    I have followed the instructions at http://www.oracle.com/technology/oramag/oracle/04-nov/o64streams.html
    The main steps are:
    1. Set up ARCHIVELOG mode.
    2. Set up the Streams administrator.
    3. Set initialization parameters.
    4. Create a database link.
    5. Set up source and destination queues.
    6. Set up supplemental logging at the source database.
    7. Configure the capture process at the source database.
    8. Configure the propagation process.
    9. Create the destination table.
    10. Grant object privileges.
    11. Set the instantiation system change number (SCN).
    12. Configure the apply process at the destination database.
    13. Start the capture and apply processes.
    For step 5, I have used the 'set_up_queue' in the 'dbms_strems_adm package'. This procedure creates a queue table and an associated queue.
    The problem is that, in the propagation process, I get this error:
    'ORA-25215: user_data type and queue type do not match'
    I have checked it, and the queue table and its associated queue are created as shown:
    sys.dbms_aqadm.create_queue_table (
    queue_table => 'CAPTURE_SFQTAB'
    , queue_payload_type => 'SYS.ANYDATA'
    , sort_list => ''
    , COMMENT => ''
    , multiple_consumers => TRUE
    , message_grouping => DBMS_AQADM.TRANSACTIONAL
    , storage_clause => 'TABLESPACE STREAMSTS LOGGING'
    , compatible => '8.1'
    , primary_instance => '0'
    , secondary_instance => '0');
    sys.dbms_aqadm.create_queue(
    queue_name => 'CAPTURE_SFQ'
    , queue_table => 'CAPTURE_SFQTAB'
    , queue_type => sys.dbms_aqadm.NORMAL_QUEUE
    , max_retries => '5'
    , retry_delay => '0'
    , retention_time => '0'
    , COMMENT => '');
    The capture process is 'capturing changes' but it seems that these changes cannot be enqueued into the capture queue because the data type is not correct.
    As far as I know, 'sys.anydata' payload type and 'normal_queue' type are the right parameters to get a successful configuration.
    I would be really grateful for any idea!

    Hi
    You need to run a VERIFY to make sure that the queues are compatible. At least on my 10.2.0.3/4 I need to do it.
    DECLARE
    rc BINARY_INTEGER;
    BEGIN
    DBMS_AQADM.VERIFY_QUEUE_TYPES(
    src_queue_name => 'np_out_onlinex',
    dest_queue_name => 'np_out_onlinex',
    rc => rc, , destination => 'scnp.pfa.dk',
    transformation => 'TransformDim2JMS_001x');
    DBMS_OUTPUT.PUT_LINE('Compatible: '||rc);
    If you dont have transformations and/or a remote destination - then delete those params.
    Check the table: SYS.AQ$_MESSAGE_TYPES there you can see what are verified or not
    regards
    Mette

  • KE24 and KKBC_HOE balance does not match....

    Hi,
         We are facing a big issues at the end of the perio 2 of 2009. Our KE24 and KKBC_HOE balance does not match. We have ccompared/hecked all our previous months balance and there it was matching accurately. But for period 2, there is a mismatch.
    Could anybody pls suggest why there is a difference. Is it becuse that KE24 will show only the itmes which are settled and KKBC_HOC inclues both Settled and not settled items..
    Pls help on this......

    hi
    as you said check whether some transcation has happend but which are not settled.

  • Serial No. and Part No. on package and on iphone do not match

    I was given on my birthday new black iPhone 5 - 32Gb. On package part No. is MD6600LL/A  but on phone model no. is ND122LL. Also serial numbers on package and on iphone do not match .Tell me please who knows what does it mean? I tested iPhone and it works fine. Thanks.

    Yeah, there is a long thread on this:
    http://discussions.apple.com/thread.jspa?messageID=7539514&#7539514
    You should look it over--you'll find instructions for a clunky work-around (haven't bothered doing it, myself) and the link to leave feedback to Apple to ask them to fix this.

  • ERROR: Your password and confirmation password do not match. [******] - has been ignored.

    In IE8m 7, 6, this error occurs. Instead of allowing the registrant to correct the mis-matched password, BC submits the form and places this in the submission report: ERROR: Your password and confirmation password do not match. [******] - has been ignored.
    The user doesn't get logged in (obviously), however BC creates a record for this user, but without a password.
    Has anyone else received this error?
    The process happens like this, user completes form, which includes password|confirm password in which the confirm password is mistyped, when "submit" is pressed, the modal window appears indicating a mismatched password. The user clicks "okay" and then the page redirects to the submission page (or to a login screen if the form is set to redirect to a specific page).
    This occured during the test phase and has been replicated!

    Can you please insert that form onto a blank page with no template around it and test it? There seems to be a problem in javascript validation.
    It's this line:
    if(why != ""){alert(why);return false;}
    So, when you click submit, the JS pops the alert if "why" varaible is not an empty string and then returns false, which means the form should not get submitted. However, on your form the browser goes on to this line and submits the form:
    if(submitcount50254 == 0){submitcount50254++;theForm.submit();return false;}
    I can't exactly pinpoint the problem, but it's in that code or some code interfering with that code.
    Cheers,
    -mario

  • Processor type of the file and the device does not match

    We ve the following problem with Zfh 7 sp1. When trying to distribute a
    application we receive the message failed. When i open the log is see the
    below message.
    The processor type of the file and the device does not match.
    I ve searched on the message and i ve seen that it is a know error and it
    should be fixed in SP1
    10100578 - ERROR: Skipped installation of file on device <DEVICE(Username)
    > GUID <XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX>. The processor type of the
    file and the device does not match.?
    The processortype of the device is StrongARM and also from the
    applications. Also when i put it on ALL/CEF it won't distribute.
    Does some other people also have this problem.

    Mail,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Print to Video Error msg: audio and vide devices may not match

    When I attempt to print to video (using a Sony DV deck that has werved me well for years) I receive the message:
    "The selected audio and video devices may not match:
    -Apple FireWire NTSC (720 X 480)
    Please verify that the audio and video outputs are externally routed to the intended device(s).
    Do you want to proceed?"
    I tried proceeding, and the video images output to the tape but without a sound track.
    What to do? I must deliver a tape to my client!
    I recently did a software update to 10.4.6. Could that be part of the problem?
    Of did some setting change somewhere without my knowing it, and I need to reset it, if so what?
    Thanks in advance

    Hello!
    Thank you for this. I did check the audio playback settings and it was NOT set to audio follows video. I then CHANGED it as you have kindly instructed. The audio video settings box you mention was NOT checked, so I didn't need to do anything there.
    I then tried o launch Print to Video (not Edit to Tape) and sadly, the same error message occurred. Any suggestions would be much appreciated.
    I am running FCP 4.5, recently upgraded to OS 10.4.6
    Thanks in advance.
    Hey Pamela,
    Have you been monitoring externally this whole time?
    If you have, and you've been getting external audio
    and video, then this is probably a case of a
    setting being off somewhere.
    First, check your View > Audio Playback
    setting. It should be set to Audio follows
    Video.
    Second, press Option-Command-Q to bring up the
    Audio/Video Settings dialog. Click on the right-most
    tab (A/V Devices) then confirm that the box for 'Use
    Different output for Edit To Tape/Print To Video' is
    not checked.
    And please confirm that you're doing a Print to Video
    and not an Edit To Tape. I ask because the only time
    that I can remember getting this message is when I've
    tried to do an Edit To Tape and didn't drag the
    correct sequence from the browser (if I remember
    correctly, I accidently dragged a sequence that was
    also open in timeline).

  • Error: Contract object  and business agreement  do not match

    Dear Friends,
    I get this error on the service order.
    Contract object  and business agreement  do not match
    Any assistance would be appreciated.
    Thanks and regards,
    Aershid

    Thanks Experts...
    Sany.

  • Selected audio and video devices may not match

    Hello - I was able to Print to Video w/no problem, from my Mac Book Pro, to my Panasonic PV-GS320 w/no problem. Now, all of a sudden, when trying to do this, I get this msg.:
    'The selected audio and video devices may not match. Please verify that the a/v outputs are externally routed to the intended device(s).'
    Not sure what happened, or what changed, but here is my setup:
    Sequence & Capture Presets are both: DV NTSC 48 kHz
    Device control preset: FireWire Basic
    Video Playback: Apple Firewire NYSC (720 x 480)
    Audio Playback: Default
    Like I said, I don't know what got changed, but, it was working before - hope someone can help, thanks so much!!
    Kristina

    I think I found the problem...I had forgotten to switch my Device Control Preset back to FireWire, from the previous non-controllable - thanks so much!
    Message was edited by: Kristina Latour
    Message was edited by: Kristina Latour

  • The version of OLE on the client and server machines does not match. (Exception from HRESULT: 0x80010110)

    Hi,
    I have installed FIM CM Client on one machine and FIM CM update service on another machine. Both are windows server 2008 r2 machines.
    When i try to enroll a permanent smart card for a user, its shows me the following error:-
    The version of OLE on the client and server machines does not match. (Exception from HRESULT: 0x80010110)
    Also there is no logging done for the particular event.
    I am able to change my smart card pin and view my smart card info. through the FIM CM client. 
    Is there a compatibility issue of FIM CM 2010 with Windows server 2008 r2?
    Thanks

    Hi,
    Sorry for the delay in reply.
    Please try the following steps first:
    Open Powershell as Administrator
    Go to Start--> Run and type wbemtest.exe.
    •Click Connect. 
    •In the namespace text box type "root" (without quotes).
    •Click Connect.
    •Click Enum Instances…
    •In the Class Info dialog box enter Superclass Name as "__ProviderHostQuotaConfiguration" (without quotes) and press OK. Note: the Superclass name includes a double underscore at the front.
    •In the Query Result window, double-click "__ProviderHostQuotaConfiguration=@"
    •In the Object Editor window, double-click HandlesPerHost.
    •In the Value dialog, type in 8192
    •Click Save Property.
    •Click Save Object.
    Under properties find the property "MemoryPerHost" or any other ones you need to modify  and double click it
    Change the value from 512 MB which is 536870912 to 1GB which is 1073741824
    Click Save Property
    Click Save Object.
    •Close Wbemtest.
    •Restart the computer.
    And if all nodes are Windows server 2012, install the following update rollup as well:
    Windows RT, Windows 8, and Windows Server 2012 update rollup: August 2013
    http://support.microsoft.com/KB/2862768
    If you have any feedback on our support, please send to [email protected]

Maybe you are looking for

  • Prototype works on PC but not on a mac

    Hey guys, I have a flash site prototype that's in developement, which has been creating it on a PC, however my client uses a Mac and for some reason the document will not run properly on his machine. So far I have a basic document with an subtle anim

  • Standard error

    Hi Gurus Can some body provide 1) what are the standard errors during the implementation/upgrade? 2) how to rectify them. Thanks and Regards

  • Is it possible to add html code to iweb

    I need to add some special elements to a webpage, and I was curious if I could add any special html code besides the ones I have found in the menu (counter, links, etc) Thanks

  • Handling circular buffers

    - I am configuring two  AI channels  for 10kHz sampling rate and starting the Task . ( LV automatically sets the buffer at 100k samples ) - The Task then feeds into a 50ms timed loop and inside of the loop I have a AI DAQMx Read set for  acquiring  2

  • InfoPath Multiple attachments on Single attachment Field.

    Hi all, I have a repeating section to attach multiple files. But, what I actually need is a field to attach multiple files at one go. is it possible to achieve this? Please shed some light into this. Thanks,