Catch only the last resize event of a window

Hi
I've gone through the forums but can't find a solution.
Only for one of my JFrames I have to watch for component resize and trigger an action after mouse has been released.
I'm listening for componentResize but get all of them during dragging. As it is only for one window I cannot disable the dynamic layout property. Next I thought to catch the mouse release event and see that resize has been done before.
But I'm not able to get this event. Toolkit.addAWTEventListener() is not informed about this mouse event.
Any idea?
Thanks in advance
Wolfgang R.

Ok, the example below produces only one final event on Windows but multiple events on Linux (jdk1.6.0)
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Sample {
     private static int count = 0;
     public static void main(String[] args) {
          JFrame frame = new JFrame();
//          System.out.println("dynamic layout: "
//               + Toolkit.getDefaultToolkit().isDynamicLayoutActive());
//          Toolkit.getDefaultToolkit().isDynamicLayoutActive();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JPanel panel = new JPanel();
          panel.setPreferredSize(new Dimension(100, 100));
          panel.setBackground(Color.BLUE);
          frame.add(panel);
          frame.addComponentListener(new ComponentAdapter() {
               public void componentResized(ComponentEvent e) {
                    System.out.println("count: " + count++);
          frame.pack();
          frame.setVisible(true);
}

Similar Messages

  • Only the last line item is shown in main window...

    Hello Experts,
    I created a custom form for the standard checque program RFFOUS_C. Now, in my MAIN window, I
    called a subroutine in a custom program which loops through the line items but the problem is
    only the last line item is being shown. I tried using CONTROL_FORM to create a new line
    but it does not work. Note that I did not customize RFFOUS_C since it is being used by
    multiple companies. Below is my code:
    SAPSCRIPT:
    510-C
    Begin of insertion DEVK940799 11/10/2008 DEL_HIDALGO
    DEFINE &LTYC_XBLNR& = ''
    DEFINE &LTYC_BLDAT& = ''
    DEFINE &LTYC_SGTXT& = ''
    DEFINE &LTYC_DMBTR& = ''
    PERFORM WRITE_LINE_ITEMS IN PROGRAM Z9999RFI_Z2574FFI_RA
    USING &REGUH-LAUFD&
    USING &REGUH-LAUFI&
    USING &REGUH-XVORL&
    USING &REGUH-ZBUKR&
    USING &REGUH-LIFNR&
    USING &REGUH-VBLNR&
    CHANGING &LTYC_XBLNR&
    CHANGING &LTYC_BLDAT&
    CHANGING &LTYC_SGTXT&
    CHANGING &LTYC_DMBTR&
    ENDPERFORM
    PROTECT
         &LTYC_XBLNR&     &LTYC_BLDAT&     &LTYC_SGTXT&     &LTYC_DMBTR&
    ENDPROTECT
    End of insertion DEVK940799 11/10/2008 DEL_HIDALGO
    PROGRAM:
    IF gt_regup[] IS NOT INITIAL.
        CALL FUNCTION 'OPEN_FORM'
           EXPORTING
    *         APPLICATION                       = 'TX'
    *         ARCHIVE_INDEX                     =
    *         ARCHIVE_PARAMS                    =
    *         DEVICE                            = 'PRINTER'
    *         DIALOG                            = 'X'
             form                              = lcc_z2574ffi_ra
    *         LANGUAGE                          = SY-LANGU
    *         OPTIONS                           =
    *         MAIL_SENDER                       =
    *         MAIL_RECIPIENT                    =
    *         MAIL_APPL_OBJECT                  =
    *         RAW_DATA_INTERFACE                = '*'
    *         SPONUMIV                          =
    *       IMPORTING
    *         LANGUAGE                          =
    *         NEW_ARCHIVE_PARAMS                =
    *         RESULT                            =
           EXCEPTIONS
             canceled                          = 1
             device                            = 2
             form                              = 3
             OPTIONS                           = 4
             unclosed                          = 5
             mail_options                      = 6
             archive_error                     = 7
             invalid_fax_number                = 8
             more_params_needed_in_batch       = 9
             spool_error                       = 10
             codepage                          = 11
             OTHERS                            = 12.
        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 gt_regup INTO lw_regup.
          m_line_items 'LTYC_XBLNR' lw_regup-xblnr.
          m_line_items 'LTYC_BLDAT' lw_regup-bldat.
          m_line_items 'LTYC_SGTXT' lw_regup-sgtxt.
          m_line_items 'LTYC_DMBTR' lw_regup-dmbtr.
          DELETE ex_output WHERE value IS INITIAL.
          CALL FUNCTION 'WRITE_FORM'
           EXPORTING
             element                        = '510-C'
             function                       = 'APPEND'
    *         TYPE                           = 'BODY'
             window                         = 'MAIN'
    *       IMPORTING
    *         PENDING_LINES                  =
           EXCEPTIONS
             element                        = 1
             function                       = 2
             type                           = 3
             unopened                       = 4
             unstarted                      = 5
             window                         = 6
             bad_pageformat_for_print       = 7
             spool_error                    = 8
             codepage                       = 9
             OTHERS                         = 10.
          IF sy-subrc <> 0.
    *        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command   = 'NEW-LINE'
            EXCEPTIONS
              unopened  = 1
              unstarted = 2
              OTHERS    = 3.
          IF sy-subrc <> 0.
    *        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
        ENDLOOP.
        CALL FUNCTION 'CLOSE_FORM'
    *       IMPORTING
    *         RESULT                         =
    *         RDI_RESULT                     =
    *       TABLES
    *         OTFDATA                        =
           EXCEPTIONS
             unopened                       = 1
             bad_pageformat_for_print       = 2
             send_error                     = 3
             spool_error                    = 4
             codepage                       = 5
             OTHERS                         = 6.
        IF sy-subrc <> 0.
    *        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.

    Hi,
    Write the at last event in the program and check if it works
      At last.
           CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command   = 'NEW-LINE'
            EXCEPTIONS
              unopened  = 1
              unstarted = 2
              OTHERS    = 3.
          IF sy-subrc  0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    Regards,
    Sravanthi

  • Function calling only the last Javascript API

    All,
    I have a function in my page header:
    function DisableANo(){
    //1
    $f_DisableOnValue('P20_B','AAAA','P20_A');
    //2
    $f_DisableOnValue('P20_B','BBBB','P20_A');
    //3
    $f_DisableOnValue('P20_B','CCCC','P20_A');
    I am calling this function on Item B's onChange event.
    When I do this, only the last //3 API is being called. If i remove //3 and have only //1 and //2, then I get //2 to work and if I remove //2 and have only //1, then I can get //1 to work.
    Can you please tell me where i am going wrong?
    Thanks!

    spriya wrote:
    Hi,
    I am trying to disable the item P20_A if the value of item P20_B is in 'AAAA' or 'BBBB' or 'CCCC'.Review the documentation:
    >
    $f_DisableOnValue(pThis, pValue, pThat)
    Checks the value (pValue) of an item (pThis). If it matches, this function disables the item or array of items (pThat). If it does not match, then the item is enabled.
    >
    So in this code (and code should always be posted using <tt>\...\</tt> tags):
    function DisableANo(){
    //1
    $f_DisableOnValue('P20_B','AAAA','P20_A');
    //2
    $f_DisableOnValue('P20_B','BBBB','P20_A');
    //3
    $f_DisableOnValue('P20_B','CCCC','P20_A');
    }If <tt>P20_B == 'AAAA'</tt> //1 will disable <tt>P20_A</tt>, then because <tt>P20_B == 'AAAA'</tt>, //2 will enable <tt>P20_A</tt> because <tt>P20_B != 'BBBB'</tt>, and so on etc...
    Try <tt>$x_disableItem</tt>:
    $x_disableItem('P20_A', (($v('P20_B') === 'AAAA') || ($v('P20_B') === 'BBBB') || ($v('P20_B') === 'CCCC')))

  • How can I get only the last 2 rows?

    How can I narrow down a query to get only the last two rows in a table ?
    Thanks,
    Mohan

    Thanks a lot Ram for your suggestion but already I have a query which returns a set of rows, of which I would like to further filter and get the last two rows
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Ramanuj Bangad ([email protected]):
    try out something like this if it helps.
    Example:
    select * from users
    where rownum <= (select count(*) from users)
    minus
    select * from users
    where rownum <= (select count(*) -2 from users )
    <HR></BLOCKQUOTE>
    null

  • I have upgrade to IOS 8 and all Fotos are ereased and on my Computer is only the last Backup and there a no Photos now what can i do?

    I have upgrade to IOS 8 and all Fotos are ereased on my Iphone and on my Computer is only the last Backup and there a no Photos now what can i do?

    You really need to try this on a computer, not on the iPad.
    Seeing how what is in the cloud is also on the iPad, if the content is not on the iPad, there is a good chance that the content is lost. But you can try logging into www.icloud.com in a web browser on a computer and log into your account and see if you can get into the Pages app. You may have to sign up for iCloud drive if you didn't do so already. Make SURE you that you read the blurb that will pop up in that window in iCloud for more information.

  • How to get the only the last raw of the table

    Hello All,
    While fetching a table into internal table, how to get only the last record of the table.?
    Thanks and Regards, Pradeep

    I hope following code will solve your problem.
    DATA : it_bseg TYPE TABLE OF bseg,
           x_bseg TYPE bseg,
           v_index TYPE i.
    SELECT COUNT(*)
      FROM bseg
      INTO v_index.
    SELECT *
      FROM bseg
      INTO TABLE it_bseg.
    READ TABLE it_bseg INTO x_bseg INDEX V_INDEX.
    First SELECT will give you the number of rows in a table in v_index. Second SELECT will fetch all table data and then READ will give you the last record of the table in a structure x_bseg.
    Reward points if the answer is helpful.

  • RFC - XI - JDBC(mapping only the last row of a record)

    Hello all,
    in a mapping response from an oracle base after a RFC call with a select statement, i have the following response :
    <StatementSelect_response>(cardinality 0..1)
    <row1>(cardinality 0..unbounded)
    <field1>1</field1>
    <field2>2</field2>
    </row1>
    <row2>
    <field1>3</field1>
    <field2>4</field2>
    </row2>
    </statement>
    i have to map those fields in a RFC_response like :
    <RFC_response>(0..1)
    <field1>
    <field2>
    </rfc _response>
    Problem : I only need to send back to the rfc_response the last records of my StatementSelect_response in order to have the following message :
    <RFC_response>
    <field1>3
    <field2>4
    </rfc _response>
    How can i select only the last row of my records plz ?
    Thanks by advance

    VJ wrote:>
    > Hi,
    >
    > public void LastRow(String[] a,ResultList result,Container container){
    >
    > int len = a.length();
    > Result.addValue(a\[len-1\]);
    >
    > }
    VJ,
    Please don't confuse him. If you want to update the thread, let me leave it aside.Coz it shouldn't cause him trouble. Can u check a.length() is correct? it has to be a.length, isn't it?
    We all here to help others, not under any motivation of compete..
    Sorry, if I hurt you..
    raj.

  • Show only the most recent event in XML list based on date

    Hello,
    I'm working with Spry and an XML list of events for my site.
    Displaying the full list of events isn't a problem. However, I'd like to display only the next upcoming event, based on the date.
    For instance, today is April 27th. I'd like to be able to display only the next upcoming event which happens to be on May 3rd. Then once that date passes, the next upcoming event is shown (May 17th).
    Can anyone give me a hand?
    Thanks!

    This seems like it's on the right path. Thank you for your response, though, I'm afraid I need a bit more help.
    I can get the statement to work, but I'm having trouble trying to figure out how to use the results. I can run the IF statement, and it checks the first value in the XML list. Since the first item in the list is older than the date I input, it just returns "false". I'm not really sure how I can make it return just the first entry that is "true".
    Secondly, I'm not sure how to get it to use the "Current Date" without manually entering the date in the if statement. Is there an easy way I can get the system date for it to check with?
    Thanks!!

  • I want to print only the last message in a thread of messages

    I have to keep hard copies of e mails.
    The problem is that as a trhead gets added to it means the print outs get longer and longer and are of course repatative
    Is there a setting that allows me to only print the most recent mail in a thread?

    Have you tried to open the last message in a new window?
    If that includes the messages you do not want to print, you could limit the printing to e.g. the first page (in the print dialog).
    For more advanced options you could look at the [https://addons.mozilla.org/nl/thunderbird/addon/printingtools/ PrintingTools add-on].

  • Urgent: Gif animation shows only the last frame when reloaded

    I use ImageIcon to show gif animations on screen. I want to use only non-looping gif animation files.
    Always when I show a gif animation for the first time it runs correctly through all the frames.
    However when reloading later the same gif animation only the last frame appears. I want to see all the frames of the animation, not only the last frame.
    So for the first showing of the animation this works well:
         icon = new ImageIcon("first_animation.gif");
           label = new JLabel();
           label.setIcon(icon);Then I show another animation and also it works well:
           icon2 = new ImageIcon("second_animation.gif");
           label.setIcon(icon2);Now I would like to show the first animation again but only the last frame of that first animation appears on screen:
    label.setIcon(icon);And even this alternative way to refresh does not work:
           icon = new ImageIcon("first_animation.gif");
           label.setIcon(icon);
    How can I reload the first animation again so that it shows all the frames not only the last frame???
    I have tried for ex. commands updateUI(); and setImageObserver but they don't seem to help.
    I am only a novice so...
    Please I would really appreciate your detailed advice what lines I should rewrite in my code and how?
    Thank you very much!!

    By flagging your question "urgent", you are implying that either your question is more important than other people's questions, or your time is more valuable than mine (or someone else's answering questions here). Both are not true.

  • I brought a cd and only the last 3 songs downloaded and cant download the rest without buying it again

    I brought a cd and only the last 3 song's downloaded if I download it again will I be charged again for it as it is saying the payment will come from my account

    Store>Check for Available Downloads
    If this fails:
    How to report an issue with Your iTunes Store purchase

  • Index an array of images only the last image shows

    Hi everyone,
    I try to index an array of images and all but the last element give me the error: "not an image."
    Here is a picture of the vi. The first for loop loads the images and stores them in an auto indexed tunnel. Every diagnostic I ran on this loop showed everything is fine. The second for loop should display the sequence of image stored in the auto indexed tunnel, but it does not. Instead I have the error message that elements 0 to n-1 are not images, and only the last image is displayed.
    What am I doing wrong?
    Thanks for your help.
    and the vi: 
    Solved!
    Go to Solution.
    Attachments:
    PulsedImageDisp1.vi ‏31 KB

    Speed of what? The second loop can't run until the first loop is done, and all the operations are linear. I'm guessing you're referring to the perceived speed of displaying the images one after the other so you don't have to wait for the next image to be read which is why you pre-load all the images. Otherwise, the overall speed should be the same whether you use one loop or two. Actually, to be technically accurate, the two loop version will likely be a little slower overall since LabVIEW has to allocate more memory to store all the images, while in the one loop version it is only ever dealing with one image. If the images are large then you might actually run into a memory issue with the two-loop version (arrays need contiguous memory). Just something to keep in mind and to be careful about.

  • How to remove only the last element of spreadsheet string

    I use path to string option to store image path into database and while retrieving the string is again converted into path but it gives out an error as the output of array to spreadsheet string gives out a tab at the end which is unable for the IMAQ read file to recognise.but when i use the path of the image directly into IMAQ readfile the image is opened . so how to remove the tab only at the end of output of the spreadsheet string(whose length can vary)? I have also attached my program with this.
    Attachments:
    retrieve_images_from_DB.vi ‏65 KB
    file_path_to_db_(images).vi ‏40 KB
    create_table_for_images.vi ‏45 KB

    indhu wrote:
    > Thanks for your reply!
    > But my problem is to remove only the last element(which is a tab or an
    > alphabet) from a spreadsheet string of any length.
    If you just want to remove the last character of a string just use the
    String Size function reduce the result by one and wire it together with
    the string to the Split String function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Display only the last record per material in SAP query

    Hi,
    I have created a SAP Query using the quickviewer that is a join between 2 tables (MSEG and MKPF) that consist of material document information and date of posting.
    The results are fine however I would like only the last record per material to be displayed.
    Can anyone tell what do I need to add so for only the last record per material be displayed in the output.
    Thanks,
    Mark

    Hi Mark,
    May be if you use Control Level processing .........I think you will be able to get the result you want. Try displaying as Below,
    LOOP AT XXXXX.
    AT FIRST material.
    ENDAT.
    AT LAST material.
    *...Display what ever you want here. It will display at end of every material.
    ENDAT.
    ENDLOOP.
    Before using sort the table with key material in ascending.
    Hope what I had to say is helpful to you.
    Cheers,
    Raga Suman.

  • I have a question about the suggestion that only the last tab loaded shows up so Firefox can load faster.

    My question is this:
    If I do as you suggest in the General Tab of Preferences - see below - how do I get all the other tabs back if only the last one shows? If they are hidden, I need to know how to access them.
    Your directions which I need help with....Don’t load tabs until selected. Voila! Now, only the last tab you were working in will be loaded on startup.
    THANKS.

    The Tabs are all there, the only thing this preference does is tell firefox to only download the open tab. If you click on the other tabs, they will download too. The theory is, by only downloading and displaying one webpage, it can be displayed for you faster than if 5 webpages were being downloaded at once.

Maybe you are looking for

  • How to add number to excel sheet work book cell?

    I am trying to create an excel sheet dynamically. I am able to create and populate the data as well. But in one of the cell I have to add 1.0 value. Since I have added this as a new Label(...), after opening the excel sheet I can see an icon in the c

  • All info on screen has become tiny, how do I get it back to normal size?

    I was looking at a page and when I went to scroll down all the information, writing and pictures, became so small I can barely read them. Like it has been zoomed out. How do I fix this as I can't see anything in the menu options. Thank you.

  • Get Finder version then do something appropriate?

    I'm sure it's simple but I can' t seem to discover the syntax to get the Finder version, like test if the user is running Tiger or not. Being a neophyte I've found and tried the gestaltVersion_info() thing but that doesn't work. I see in the Finder d

  • End of support 8.1.7

    where can i get the info on the end of support for oracle 8.1.7

  • Object Replication / Many objects

    What is the best approach to introduce a new object to replicate to a group after a previous object has been replicated? Imagine, peer A shared object A to the group using addhaveObjects(0, chunks(A)) and all peers successfully replicated that object