Resize events and bad frame location

Hi
I'm writing an application with a main frame and a non-modal
dialog. I'd like to keep the two windows at the same distance
so I've to know when the user moves the main frame or resizes
it. I've added a ComponentListener to the main frame and ...
I've noticed a strange behaviour when I receive resize events.
While I'm dragging the left edge of the main frame, resizing
it, the method getBounds returns always the old location:
only the frame size changes.
I can't understand where is the mistake!
I'm using the Sun JDK 1.5.0_06 under Suse Linux 9.3 Pro.
Thanks and Regards
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import javax.swing.JFrame;
public class ResizeTest extends ComponentAdapter {
     public ResizeTest() {
          super();
          mainFrame = new JFrame("Test Frame");
          mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          mainFrame.setBounds(100, 100, 400, 200);
          mainFrame.addComponentListener(this);
     public void setVisible(boolean visible) {
          mainFrame.setVisible(visible);
     public void componentResized(ComponentEvent e) {
          System.out.println(mainFrame.getBounds());
     public static void main(String[] args) {
          ResizeTest testFrame = new ResizeTest();
          testFrame.setVisible(true);
     private JFrame mainFrame;
}

I've just made some tests.
Using both JRE 1.5.0_06 and JRE 1.4.2_08 on my Suse
Linux workstation, only "width" value changes.
Using JRE 1.5.0_04 on Windows XP, it works. Only one
resize event has been sent (at the end of the drag
phase), however ... bounds are correct.
Yes, it seems a version/platform issue.
Thanks a lot.

Similar Messages

  • Resizing events, and blocking application

    Hi,
    While developing my application, that displays the state of processes, I observed something I can not duplicate that good. While debugging the app, I observed that when I manually resize the window size, my application could block (as in not response any more and stop running altogether). As said, I can not duplicate the problem. At the moment I can resize the window while it is updated, and the app keeps on running and stays responsive. But to solve this (potential) problem, should I add an event listener like WindowStateListener? Does this method catch window resizing events? And could I then add to my code something like
        public void windowStateChanged(WindowEvent e) {
            repaint();
        }Or, stated otherwise, to what event should I listen so a window resize event can be caught, and used to repaint the window?
    Abel

    I think that before resizing a windowActivated() event is generated... you could use this to set up your task before the window is resized. Of course, an activation doesn't mean resizing but perhaps it could help.
    Regards.

  • [XNET] Handling Event and Cyclic Frames

    Hi,
    I'm working with NI-XNET 1.1.1, and a PXI-8513 CAN Card.
    I'm using dbc databases created with CANdb Editor.
    In these databases, there are Periodic frames, event frames, and frames set as P+E (mixed).
    Using the XNET Database Editor, there is no choice for this kind of mixed frames.
    I've tried to create 2 different frames with different names but with the same ID, one set as Event and the other set as Cyclic.
    This method seems to work, and permits to have a cyclic frame sent with sometimes an interleaved frame.
    But the problem with that method is that I need to modify the .dbc databases to take into account the frames with P+E settings.
    Those dbc are given to me from automotive customers, and I should not modify them.
    Is there an other way to handle those mixed frames? Is there something planned to handle the P+E settings with NI-XNET?
    Regards,
    Olivier L. | Certified LabVIEW Developer

    Hi,
    Finally There is two other possible options.
    1- You can Stop a session and restart it immediately. In this way, the time you restart the session sends immediately a frame on the Bus, thus creating a kind of event frame.
    The problem with this method is that your period is now synchronized with the reset of the session, not the original start.
    2- You can create 2 sessions on the same Frame,a Single-Point session, and a Stream Session. The single point session will take care of the periodic behavior of the frame, than you can call a Write on the Stream Session to create the Event frame, because this mode doesn't take care of Timings in DBC.
    Hope this could help anybody else.
    Regards,
    Olivier L. | Certified LabVIEW Developer

  • Table maintanence generator Events and BADI

    hi,
    We are in middle of creating technical design.  The scenario is given below.
    A BADI is implemented and the we are writing code for saving data in a table and we are writing events in table maintanence generator for this table to validate the data before saving.
    So if error occurs, we can't populate it as error message as this is done in between of BADI.  So how to capture these error messages and give to BADI.
    I am thinking to use EXPORT and IMPORT to memory.  Will this work?  Or is there any other method for this?  I am not able to check in SAP as the client doesnt want to create anything before signing off the TD.

    I answered the exact same question a few minutes back in another thread. Hope this works.
    read table new entry
    For the others who have answered this question:
    I tried referencing the table directly and whenever i enter multiple entries the validations where failing. I could not do a loop at table. My validations were supposed to be triggered only at the time of saving the entries and not at the time of entry. Anybody has a workaround besides what i have described in the post??

  • Moving Events and Projects from one location to another on the same hard drive.

    Hello.
    I've searched in the FCP X User Manual, on this forum and in Google, but have found no explanation of how to do this, so I'm posting this here in hopes that someone in our community will be able to help.
    I've previously stored my FCP X Events and Projects folders on an external 3TB hard drive, because there is more room on it than on the internal 1TB hard drive, but, since then, I've worked with other media apps, for video, photography and audio, the files for which are also stored on the external hard drive, and this has created a bit of clutter with no folder structure to keep it tidy.
    I like an organised file structure on my system, to keep it uncluttered, easy to navigate and efficient to use, so I put all the files for my photography, video and audio apps into their own folders, which are, in turn, stored in their appropriate folders for Audio, Photography and Video, and those three folders are stored in a folder called Media, and then I directed each app to its own files.
    The only app with which this has been a problem is FCP X. While there is a way of relocating projects and events from within FCP X, it allows the user to move them from one hard drive to another, and not, as I want, from one place to another on the same hard drive.
    I'm not sure if it matters, but perhaps it's relevant to mention before the next paragraph that the files that had previously been imported as events are, to save hard-drive space, stored in the events folder as shortcuts to the original files, which are stored elsewhere on the drive, rather than as duplicates of those files.
    In Finder, I copied the Events and Projects folders to their intended new locations and tried in the app to link the events and projects to their new Finder location. It seemed to have worked, until I moved the original folders to the Trash. On re-opening FCP X, it was clear that the linking hadn't worked. I returned the original folders from the Trash to their original location, but that didn't entirely reverse the problem. I noticed also that, in the original and duplicated Events folders, the shortcuts had lost their links to the original files stored elswehere on the drive.
    Fortunately I had run a backup before starting, so I restored the original folders and the app from the backup, and all was back to normal.
    I'd be grateful if anyone could advise me on whether or not it's possible to move FCP X events and projects from one place to another on the same hard drive with the app's compliance.
    Thank you.

    Ludio wrote:
    I'd be grateful if anyone could advise me on whether or not it's possible to move FCP X events and projects from one place to another on the same hard drive with the app's compliance.
    I
    Message was edited by: Russ H Apparently mis-read the questions.

  • When I download photos from a flash drive,everything is fine and they show in Events and Pictures, but when I click on the individual pic I get an error message saying that it cannot locate the JPG. Any thoughts?

    When I download photos from a flash drive,everything is fine and they show in Events and Pictures, but when I click on the individual pic I get an error message saying that it cannot locate the JPG. Any thoughts?

    It sounds like your iPhoto Advanced preferences are set to not copy photos during import, i.e. a Referenced library:
    Check your Advanced preferences to see if that's the case. If it is the best solution would be to select the checkbox to copy the photos and reimport the photos from the flash drive.  Then check the new import. It it was OK you can delete the previous event with the "missing" photos.
    OT

  • How can I create a matrix question? Specifically, I need a question in table format that allows each respondent to list a number of events and then data for each event (date, location, number of participants, topics covered, etc.

    How can I create a matrix question? Specifically, I need a question in table format that allows each respondent to list a number of events and then data for each event (date, location, number of participants, topics covered, etc.

    Hi,
    Sorry, we do not support a matrix-question field.   Please try the multilines text field (where your participant can enter multiple lines in the input text box) and see if it works for you.
    Thanks,
    Lucia

  • Can Touch Events and Swipe Events exist in the same frame and/or movie?

    After having fully tested a file with touch events I decided to add both a touch event and swipe event to a frame.
    I started by importing the following statements:
    Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
    Multitouch.inputMode = MultitouchInputMode.GESTURE;
    I then added th appropriate code but only touch events worked. I fiddled so more and only the gesture events worked. So before I move any further, I'm wondering if I'm wasting my time trying to get them to work together.
    So my questions are:
    Can Touch Events and Swipe Events exist together in the same frame?
    Can Touch Events and Swipe Events exist scene?
    A reference to more information about this would be helpful, if you know of any.

    I am aware of the latest releases of the components along with the plug-ins.
    This note is applicable to your scenario but you might face some issues related to organization rule wizard, custom user group creation and EAM DB log collection, as mentioned at the bottom of the note. No matter on what SP level you are with GRCFND_A at 10.1, you would face these issues.
    And so far, i don't think there is any more update from SAP on co-existence of plugins of 5.3 and 10.1
    Ameet

  • Skipped or bad frames causes "Unknown error" while trying to fuse or export as...

    Hi. So, I'm trying to fuse footage from my Canon xf305 -to- an H.264 Youtube HD 29.97. I've successfully done this many times before, but this, one, particular clip has some problems. WithIn the roughly 10 minutes of this clip there are 4 small sections that the footage (video portion) seems to stall onto a still frame. This lasts literally for mabe 5 frames or so, and then the video continues. other than that the clip plays fine on the timeline, It's almost undetectable, but when I try and export out to any other format, Premiere gives me an "Unknown Error" about halfway through the export/fuse.  What's Up With That?
    I's there a way to "Force" Primiere to ignore those bad frames and export as best as possible?
    Thanks in Advance for any answeres.   Rich

    First thing I'd recommend is deleting the Cache files.  Go to Edit>Preferences>Media... and take note of their location on the hard drive.  Then close down PP and use Windows Explorer or Finder to delete those files.  When you reopen your project, PP will rebuild those files.
    Second thing I recommend is adding your voice to the following feature request to make this process easier.
    http://forums.adobe.com/thread/1369263?tstart=60

  • Background Behavior for iOS - the Suspend event and executeInBackground

    It looks like suspend is not being defined in airglobal.swc. It just says (line 836 of flash.events.Event.as):
    public static const SUSPEND : String;
    Also, when attempting to compile in, ah, Flash CS<NDA> with "AIR 3.3.0.3230 for iOS" as the target, adding <executeInBackground>true</executeInBackground> to the app xml's <iPhone> node results in an alert:
    Unexpected or unknown element or attribute in the application descriptor file.
      application.iPhone.executeInBackground is an unexpected element/attribute
    Is there any way to test these things with this beta?

    It happens to me as well. I did try to put this variable in flash coding, but I need try {} catch to be able to test in flash builder otherwise it crash with no error appear.
    try {
        NativeApplication.nativeApplication.executeInBackground = true;
    } catch (e:Error) {
    } //Without try catch.. Flash builder crash at this line with no error notification. But in iPhone4 without try catch it runs fine
    However, when I test my application in iPhone4 iOS 5.01, I got nothing when the app is in background (I tested by firing post variable via url loader to server with enterframe event 40-50 frame once, and  by add location update event listener to Geo object also).
    I think the problem is <executeInBackground>true</executeInBackground> which is added to <iPhone> tag in app.xml can't be compile by flash builder.
    note: I've also changed application description to air 3.3
    <application xmlns="http://ns.adobe.com/air/application/3.3">
    and added location service in
    <InfoAdditions><![CDATA[
                                  <key>UIDeviceFamily</key>
                                  <array>
                                            <string>1</string>
                                            <string>2</string>
                                  </array>
                                  <key>UIBackgroundModes</key>
                                  <array>
                                            <string>location</string>
                                  </array>
      ]]></InfoAdditions>

  • Multiple problems with installation and stop frame animation

    I have just spent 24 hours of increasing frustration trying to install and use On Location. I recently bought a Matrox RTX 2 Premiere CS3 desktop edit suite. On Location recognises any camera I attach via the drop down menu but will never display a video image or activate any capture commands. An afternoon with my dealer's tech support did not find a solution.
    Next I tried installing it on my Vaio laptop. It would not display the menu bar, but components would display, my camera was recognised, and I managed to capture avi type 2 files in mpeg at 1080i PAL. These will play back on the laptop in media player but crash Premiere when I import them. Matrox say these files should be supported. After these tests, OnLocation began to crash the Vaio as soon as I plugged in a camera. The Vaio presents a black screen and the OS freezes completely, requiring a hard boot for recovery.
    I have uninstalled it and attempted to install it in a brand new Vista HP laptop. The install crashes during activation. After 3 uninstall/reinstall attempts I gave up. I will now start again with a fresh install on the Vaio. Will report back if I make any progress today. Any suggestions meanwhile would be much appreciated.
    The holy grail, by any means possible, is to capture stop frame animations in HDV 1080i PAL format. I need one laptop to work for capture, then to transfer the animation files to the desktop for editing.
    many thanks

    Hi Martin,<br />Sorry to hear you're having such problems. I have no experience with Matrox system, so I cannot speak directly to compatibility with OnLocation CS3. For both computers, I'd be interested in seeing the system specs. If you're willing, how about sending the dxdiag file for each to me at [email protected] I'll see if anything jumps out at me.<br /><br />One detail that does not compute is your reference to recoring "avi type 2 files in mpeg at 1080i PAL." HDV content cannot be recorded to the AVI format. The only options are MPG and M2T. If the clips are indeed AVIs, then the camera must have been set to the DV mode.<br /><br />As for OnLocation crashing the computer so badly that a hard reboot is necessary, that generally points to some deeper problem in the computer's drivers or BIOS. When it gets into that state, have you tried bringing up Windows Task Manager (CTRL+SHIFT+ESCAPE) and killing the OnLocation process? I'm wondering if the system isn't totally locked up but appears to be so because on this low res display, OnLocation has basically taken over the whole display, so when it fails to launch, you can't see any other Windows controls. If this is the case, then deleting the AppProps file here: C:\Documents and Settings\<username>\Local Settings\Application Data\Adobe\OnLocation CS3.<br /><br />btw, the reason you see no menu bar is that the laptop's display is at the minimum for OnLocation CS3 (1024x768, if memory serves). The menu is shown only at higher display resoltions.

  • 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);
    }

  • Managing Events and/or Projects With Disk Images

    I came across this method of managing Events and Projects a while ago. I finally got around to giving it a try. Personally, I really like this method.
    It's simple.
    It keeps things very well organized.
    It's easy to open only the project or events that you want.
    It's easy to consolidate and back up once you're done.
    It  takes some workload off FCP X by not having to always open up all your Events and Projects.
    So, I thought I would share this for those of you who were not already aware of it.
    This is my workflow: (based on the link below)
    I create a Disk Image (named for the Event/Project).
    (Note: There are two places to create the name, I use both, keep them the same)
    I open up FCP X.
    I typically put only one Event on this Disk Image.
    I then reference whatever Media I need in this Event.
    I usually don't bother to copy the media. (except when I'm done and I archive it)
    You can create multiple Events, if you feel the need for additional organization.
    Then I create however many Projects I need.
    (since Projects equates to Sequences from prior FCP versions)
    I have a unique Disk Image for each Event/Project that I work on.
    To use them ...
    First, always make sure FCP X is not running.
    Locate the Disk Image in finder.
    Double click on the Disk Image and it will Mount on your desktop.
    (assuming it's not already mounted on your desktop)
    Open up FCP X and it will load the Event(s)/Project(s) in the Disk Image.
    If you don't want to work on an Event/Project in FCP X (make sure FCP X is not open), in Finder, simply Eject the Disk Image.
    Now when you open FCP X, it won't be there.
    Its not gone, but since it's not mounted on the desktop, FCP X simply doesn't see it.
    To get it back (obviously quit FCP X first) simply double click the Disk Image in Finder and it remounts.
    Open FCP X and you can see it's back.
    You can open (double click to mount) as many Event/Project Disk Images as you want.
    Just make sure you mount and un-mount disk images when FCP X is not running.
    If find this to be a great workflow.
    Many thanks to Steve Martin of Riple Training for posting this method.
    http://www.kenstone.net/fcp_homepage/fcp_x_managing_disk_image_martin.html

    Re the final commercial spot.  What I am getting at is if all my media is optimized and therefore in ProRes, and I export in ProRes using the current settings, then shouldn't the media needed to rebuild the project be the same or close to what an exported Quicktime would have been?
    Perhaps the notion of "used clips only" is not what it says then.  I took that to be the "media managed" feature otherwise why is that wording there.  I guess "used" actually refers to all of the media for the project and associated events rather than just for the project.  This is misleading because the DUPLICATE operation and menu prompt only appears as a result of requesting an action on the project item.
    There are aliases in my original event folder, but before I started this process tried to get FCPX to consolidate media for the project and it already was according the app.  Truth is, some of the media is outside of the FCPX required folders.  So it's strange that it says it's consolditated, but it's not and yet in duplicating the project it moves the references to the new volume only to point back to the old volume.
    So my next question would be: Is there no feature to back up only what's needed to rebuild the final project (edit) reliably.  Moving the project moves everything.  According to the FCP manual, it seems using the Duplicate feature is the way I should be archiving.  However if by "used clips only" FCP X means all media and refrerenced events, then I guess there's nothing for me in here.  However then, whey would there be an option (after choosing duplicate project) an option to Duplicate Project and  referenced events.  If "used clips only" means all media, then there's no difference between the 2nd and 3rd Duplicate Project options.
    Thanks Tom.

  • I open FCPX, see Events and Projects, then they disappear

    Here's what's going on:
    1. Was using macbook to edit, via an external drive (with events and projects folders on root level)
    2. Tried using Imac to edit, so I closed everything out,  Unmounted  drive and mounted it on iMac before opening Final Cut.
    3. Opened FXP X and found that one of the elements was simply not in any of the projects that used it. It is possible, I suppose, that During the creation of these elements I was using a clip stored not in the elements folder, so it was lost track of, but there's no red frames saying I've got detached Video.
    4. Tried opening the backup I'd made of events and project folders on my second external drive (events and projects folders also on root level.
    5. At first when FCP X opens, I see the projects and events that I want to see, including the missing event appearing in the project list thumbnail sorta timelines in the project browser, but within seconds, projects and events diappear, leaving FCP looking like there are no projects or events.  Clean Slate.
    6. I notice that the events and projects browsers at first show events and projects as being contained in the external drive. When all disappears, it seems to be because the external drive is no longer recognized or superseded by the Macintosh HD, which becomes the only HD shown in either browswer.
    Not sure if the 1st issue (disappearing element) and the 2nd (disappearing events and projects before my eyes) are related.
    But at a loss.
    Thoughts?

    Projects and events can disappear if they are exact copies, clones of other projects and events on other drives.

  • Is there a way to achieve 'Panel Resize Event Filter' like function?

    Gopalakrishnan P
    Hi all,
    Panel resize filter is not available in Event structure. So if I use the below code, on pressing the maximize button, windows will maximize the front panel and later LabVIEW brings it back to the mentioned size. There will be a flicker during this operation. To avoid this flicker, is it possible to disable windows OS to perform maximize event or to set the default window maximum size in windows or any other way to implement this?
    The maximize button should not be disabled, but  have to maximize the panel to a specific size without that flicker. What I'm actually trying to do is to use windows messaging queue to capture the maximize event and then implement the same through LabVIEW. Related example is in this link http://zone.ni.com/devzone/cda/epd/p/id/4394 
    Has anyone tried solving a similar problem by this method?
    Also please suggest if there is any other way to achieve this.
    Gopal
    Thanks,

    Hi Krishgopal,
    Please try the following method
    File»VI Properties and choose Window Appearance from
    the Category pull-down menu.
    Click the Customize button and Deselect  the option : Allow user the resize window
    Attached is a screenshot of the same.
    Please let me know if this is able to help you out.
    Regards,
    Ankur
    Attachments:
    No_Resize_Front_Panel.pdf ‏274 KB
    Sample_NoResize.vi ‏6 KB

Maybe you are looking for

  • Please help--Error message in PSE 7

    When I open PSE 7 I'm getting an error message that says: Microsoft Visual C ++ Runtime Library Runtime Error Program....Adobe Photoshop, etc This application has requested the Runtime to terminate in an unusual way. Please contact the application su

  • How do I cut and paste a link into firefox?

    Can't seem to get it right

  • Oracle 11g SE One Performance Monitoring and Tuning

    I've recently "downgraded" a couple databases from Enterprise Edition to Standard Edition One and in doing so lost the use of Grid Control, specifically Performance Pack. Now, of course, monitoring and tuning, is a bit more cumbersome. Can anyone off

  • Reading post script files

    Does Adobe offer a program that reads post script files?

  • How to make text bigger?

    Once again when you want to do something simple it seams impossible. how can I make the event text bigger in all views? I see the adjustment fro printing the calendar but not for viewing. Thanks for your help G5 Quad 2.5 Ghz, MacBook Pro 17 Core Duo