How to capture frame maximizing/minimizing event?

I have a requirement.
I have a JTable. The preferred size of the table should be set dynamically when the JFrame/window is maximized or minimized.
If the window is maximized the preferred size should be
     table.setPreferredSize(new Dimension(1200, 370
If the window is minimized then preferred size should be
     table.setPreferredSize(new Dimension(715, 370);
I thought of a solution like if I capture maximize / minimizing event then I can set preferred size accordingly. I need some help
to capture those events.
Or if any other solution can be given for this requirement means also it is fine.
Anybody guide me to capture frame maximizing / minimizing event

Hi,
I have coded my requirement as below:
mainFrame.addComponentListener(new ComponentListener() {                                           // frame where panel->scroll panel is fixed
               public void componentResized(ComponentEvent e) {         // captured the events by passing component listener
                    if (mainFrame.getExtendedState() == 6) {      // captures the window maximizing event
                         table.getTablePane().setPreferredSize(
                                   new Dimension(1250, 450)); // set required size
                         table.getTablePane().revalidate(); // revalidated.
                    } else {                                                                               // captures window restoring event
                         table.getTablePane().setPreferredSize(
                                   new Dimension(715, 450));
                         table.getTablePane().revalidate();
               public void componentHidden(ComponentEvent arg0) {}
               public void componentMoved(ComponentEvent arg0) {}
               public void componentShown(ComponentEvent arg0) {}
Thanks for everyone who helped me.

Similar Messages

  • JComboBox: how to capture the internal list  events?

    Hi
    Does anybody know how to capture JComboBox internal list events, what I mean
    is when I click the box arrow button a list of the items pops up and as you move the mouse inside that list up and down, an items gets highlighted.
    So I am interested in capturing those events - basically when the next item from the list is highlighted.
    Thanks

    You can add an item listener to the combo box for that. IIRC, your listener will get
    notified twice: once for the deselection of the previous item, and once for the new
    item's selection.
    : jay

  • How to fix for maximizing minimizing frames when screen resolution changes

    Hi, all
    I guess this must be an old question, but please help me.
    Thanks

    To occupy maximum space for JFrame
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    frame.setSize(toolkit.getScreenSize().width, toolkit.getScreenSize().height);(or)
    frame.setExtendedState(JFrame.MAXIMIZED_BOTH);

  • How to capture the media player events on Safari (Windows)?

    [Source]
    <script type="text/javascript" for="wmp" event="PlayStateChange(e)">
    alert(e);
    </script>
    <embed src="mms://~~" type="video/x-ms-wmv" id="wmp" name="wmp">
    How can i get the media player events?
    I think "PlayStateChange" dosen't work.
    Please help me..

    i want to listen the events fired on the title bar....It seems you are trying to capture some other events(???) other than Window_Minimized ,Window_Closed and Window_activated.
    Could you pls explain what are those events you wish to trap ?

  • How to capture frames in Premier Pro to edit in Photoshop with correct aspect ratio.

    I am using Premier Pro and Photoshop CS5 in Creative Studio CS5.  I have read and understand several help articles on square and rectangular pixels used for various video aspect ratios.  I am using the camera button on the bottom right of the Program monitor to captue a frame and save as a jpg file.  When I open the jpg file in Photoshop to edit for a DVD disc cover using the Elliptical Marquee Tool with a fixed ratio of 1 to 1, the result is not the circular image I need but wider.  This must be an aspect ratio conversion that I am missing.  I have seen conversions that correct this by lengthening the height but the image is also lengthened and thus results in a distiortion.
    How do I correctly deal with this aspect ration conversion between Premier Pro and Photoshop without distortion?

    This is most likely a PAR (Pixel Aspect Ratio) issue. With SD (Standard Definition) Video, you can have Standard 4:3 w/ PAR = 0.9, Widescreen 16:9 w/ PAR = 1.2, or a non-standard 4:3 w/ PAR = 1.0 (rounded PAR's for NTSC).
    In Ps, you have the ability to adjust the PAR, under the Image menu from the Toolbar. For use on a DVD, you would choose a PAR of 0.9 if you have Standard 4:3, or 1.2 for Widescreen 16:9.
    With the PAR adjustment, to match your Video footage, you should then be able to get what you want, without the distortion. Also, note that one can change how the PAR displays in Ps. By default, it will be Square Pixels, or PAR = 1.0, and you should get an info message that the display is not showing the exact PAR. This can also be changed in Ps.
    For more discussion on PAR, see this article: http://forums.adobe.com/message/3456609#3456609
    Good luck,
    Hunt

  • How to capture the PrintScreen button event in keyboard

    Hi
    The JPanel consists of all components , and finally the panel is added to the JFrame.The problem is to avoid the user by capturing the page through "PrintScreen" button in the keyboard.
    Thank u .

    Hi,
    I believe that you must use JNI to access .dll to do that... you can not use any keyListeners for that!!!
    JRG

  • How to capture previously clicked button(previous event)?

    Hi guyz,
    I have frame in which i have different panels. I would like to capture the last clicked button. My objective is to bring a pop-up box(dialog) when anything other than a specific button is clicked in one of the panels. So, i would like to know if i can see what button was clicked previously. Does anyone know?

    How to capture previously clicked button(previous event)?Store it somewhere and then you can use it later:
    ActionListener previousActionEvent;
    JButton b = new JButton();
    b.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent evt){
          previousActionEvent = evt;
    });

  • How to capture show layer and hide layer event in photoshop through a plugin???

    How to capture show layer and hide layer event in photoshop through a plugin???for mac

    Use the Listener plug-in found in the SDK to see how you can monitor the show/hide layer event. You can also use the Getter plug-in to show what information you can find out about the current state of Photoshop.

  • How to capture the current info in the top-of-page event in Reuse block dis

    How to capture the current info in the top-of-page event in Reuse block dis

    Hi Geetha,
         If you don't have any information to pass the Heading Block, then why you are using this event ?
         please comment/ remove that TOP_OF_PAGE code. and use subtotal code in field catalog block.
          you can use below code for subtotal. 
          FORM field_catalog .
                    gs_fcat-do_sum = &2.
              fcat : 'WRBTR' '15' 'X' ' ' ' ' 'WRBTR' 'Amount',
           ENDFORM.
           Regards,
           Kunjan

  • How to capture the event in ALV grid display?

    Hi experts,
      How to capture the event in an ALV grid display which is editable. I have to capture the TAB key or ENTER key.
    regards,
    Arul Jothi.

    Hi Arul,
    Take a look at sample program BCALV_EDIT_03. (Find string "register ENTER" in the program to see how to register)
    Basically you have to Register edit events using method call REGISTER_EDIT_EVENT and then write a handler method for event DATA_CHANGED..
    If you are using a REUSE..GRID fm then first get the grid reference using function module GET_GLOBALS_FROM_SLVC_FULLSCR and then repeat the above procedure..
    Hope this helps..
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • How to privent the users from resizing/maximizing/minimizing the mdi window

    In http://forms.pjc.bean.over-blog.com/60-index.html i read about 'A JavaBean to handle the Forms applet's frames' .
    In formsframe.java It is written that the author is Francois Degrelle so i want to ask Francois: My goal is to privent the users from resizing/maximizing/minimizing the mdi window. I have jre 1.6.0_10 which jar file do I need formsframes5.jar or formsframes.jar (those files are in formsframes.zip)
    thanks

    lidochca wrote:
    Hello, please help me to solve the problem !!Key Loggers, Spyware. The solution is not to write such reprehensible crap.

  • How to display internal frame on click event from another internal frame

    hi me developing desktop application in netbean. i have some problem. plz reply me as soon as possible. feedback me on [email protected]
    1. I want to invoke an Internal Frame by click event that is in another internal frame. how i do it. I tried my best
    2. how can i call reports (ireports) from swing application

    Read the JInternalFrame API. You will find a link to the Swing tutorial on "How to Use Internal Frames" which contains a working example.

  • Click event on Autosuggest Listbox. How to capture it ?

    Hello.
    I'm trying without much success to understand how to capture
    the click event on the listbox associated with the Spry Autosuggest
    Widget.
    At this address:
    http://labs.adobe.com/technologies/spry/samples/autosuggest/SuggestSample.html
    it is described how to use the widget. For an istance when
    you type 'Ado' in the first textbox of the page, the listbox (or
    what looks like a listbox) appears with all the possible Adobe
    products beginning with 'Ado'. As the user clicks on a product,
    let's say 'Adobe Acrobat Professional', its description is passed
    to the textbox.
    Fact is, I would like to capture the event of the clicking on
    the Listbox item. Is there a way to obtain that ?
    I would really like to be able to call a JS function when an
    item is selected there...
    I would appreciate any help to solve the problem.
    Regards,
    Newcomsas

    Hi, adding an onClick event handler ist quite easy. my code
    looks like this:
    <div id="VKundenAS" spry:region="dsKunden">
    <div onclick="updateVKundenUUID('{f_uuid}');"
    spry:repeat="dsKunden"
    spry:suggest="{f_name}">{f_name}</div>
    </div>
    Just add the event handler to the corresponding list element
    (here it is a DIV-tag).
    Unfortunately this only works with mouse interaction
    (onClick), if you navigate with the keyboard, no custom JS is
    called. So you have to disable keyboard selection on the
    autosuggest widget, in order to make sure the JS gets called.
    Best wishes,
    Nils

  • How to improve Ni-IMAQ LVDS Sequence Capture Frame Rate?

    Im trying to collect 300 consecutive  frames off a 60hz, 320x240 16 bit camera on Win2000 (1.5Ghz, 512MB).
    Using the HLSequence vc++ sample project as the baseline, Im just
    changing  the NUM_SEQUENCE_BUFFERS to 300, and use GetTickCount
    (10ms granularity) to time it:
    unsigned long   skippedBuffers[NUM_SEQUENCE_BUFFERS] = {0};
    errChk(imgSequenceSetup (Sid, NUM_SEQUENCE_BUFFERS, (void
    **)ImaqBuffers, skippedBuffers, TRUE, TRUE));
    before  = GetTickCount();
    while ( status )
            errChk(imgSessionStatus (Sid, &status, &currBufNum));
    after = GetTickCount();
    After several iterations, it seems the difference in ticks between
    the  before and after is around 1372... which at 10ms between each
    tick,  indicates over 13 seconds to complete!  At 60hz, Im
    thinking 300 frames  SHOULD be about 5 seconds.
    Are the buffers that IMAQ "Sequence" uses for the capture,
    internally  dma'd to the *PC's RAM* memory or is it actually using
    the *disk* to  store it?
    What can I do to get it near 60 frames a second?
    Also, I dont know of any way to timestamp each frame, but is there any
    way to see how contiguous the frames are that are captured?

    Hello snoop911,
    I posted an answer to a very similar post yesterday.  See Here.
    Please let me know if you have any other questions about this issue that I can help with.
    Regards,
    Angela
    Applications Engineer

  • How to capture Flash SWC events?

    Can someone point me in the right direction on how to capture an event from a Flash SWC in Flex?
    Scenario:
    I have an animated gameboard that I built in Flash. Nothing fancy, just a simple tile game where you select a tile, click it and it flips over to reveal something.
    I've managed to export a SWC, and get it to display just dandy in my Flex project, but I cannot figure out how to get Flex to capture and respond to any type of event... custom or predefined (such as MouseEvent.CLICK) when clicking one of the tiles in the swc.
    I've done quite a bit of googling but I'm cross-eyed at this point and could use some expert direction.
    Thanks in advance.
    JL

    Hi Alex,
    After further research, I've found some answers to my questions, but I've encountered a related obsticle.
    I finally stumbled upon the Flex 3 Component Kit documentation, and on page 9 of that document, it describes in detail an example of adding custom events.
    To summarize, my related obsticle this:
    I created a simple MovieClip symbol in Flash (named "My Circle").
    I created a simple external class mimicing the example code in the Flex 3 Component Kit documentation (named "MyCircle.as") which extends mx.flash.UIMovieClip
    The .fla containing the MovieClip symbol "My Circle" and the external class "MyCircle.as" reside in the same directory
    In Flash I convert the symbol "My Circle" to a Flex component and verify that the class is "MyCircle" and there is no base class
    I export the now converted MovieClip as a .swc file
    In my Flex project, I add MyCircle.swc to the Library path
    In my Flex project source I add an instance of MyCircle as <local:MyCircle id="my_circle" />
    Switching to Design view in my Flex project I don't see anything. I refresh design view and still do not see a graphic representation of my .swc file. There are no errors or warnings
    Using the Outline, I select the instance of MyCircle and discover that it is indeed on the stage, but it's bounding box dimensions are essentially zero. It seems there is no image in the swc.
    Returning to Flash, I duplicated the MovieClip symbol, renamed it to "My Circle No External Class", and converted it to a Flex component. I also verified that this new component had a class name of "MyCircleNoExternalClass" and had a base class of mx.flash.UIMovieClip.
    Following the above proceedure to correctly link it to my Flex project's Library path and adding an instance of <local:MyCircleNoExternalClass /> to the source, the .swc file show's up beautifully.
    So, why would adding an external class file (with the ultimate goal of being able to dispatch custom events) cause the contents of the MovieClip itself to not be included in the .swc?
    Again, I'm following the example on page 9 of the Flex 3 Component Kit documentation and using the Flex 3.3 SDK.

Maybe you are looking for

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

  • Problem with iWeb publishing to IE

    Hello, I am experiencing a problem with iWeb '08 publishing content to Internet Explorer. The images and web pages look fine in Safari and in Firefox, but a lot of the web page images are mirrored in IE, covering up large parts of the text. Please do

  • MS Excel 2008 will not remember my page setup :0

    I am using MS Excel 2008 and have my page setup for 11x17 sheets in a landscape mode. I have set the print area and the sheet size. Every time I close Excel and re-open it, it reverts back to an 8.5x11. Anyone else experience this? It is really getti

  • Wich software should I use to create a game??

    I'm sorry if I did not find answer to my question in the forum, but I don't understand so much english. I would like to create a game, and I'm searching for the software. could you help me? Thank you

  • RoboHelp 10 questions

    We are looking at a trial version of RoboHelp 10, and there are certain issues I'm trying to get a handle on. (We currently use RoboHelp 8.) So far working with the trial version for a couple of hours (and viewing a few brief Adobe videos) has not he