Set z-order of Frames

Hi, I have an application that has a lot of open Frames, and one main control bar frame. (Looks like an old Macintosh app, with windows all over the place.) When I'm using this app in windows, and switching back and forth between other apps, the windows associated with this app get "lost", ie hidden behind other frames.
What I'd like is when the user activates the control bar frame, it brings all other frames to front, followed by the control bar frame. So I wrote a window listener for the control bar Frame, see below. But it's not working, because apparently the windowActivated event sometimes happens after the bringFramesToFront method is called and sometimes not; when it does, the Frames fight each other for focus. The other problem is that, even when this works, the Frames come up in apparent random order. I'd like them to maintain thier z-order with respect to each other, but be on top of all my other windows.
Is there an easier way to get/set z-order for Frames in Java? Note, I am stuck using Frames and not JFrames because of legacy issues.
boolean ignore=false;
// I tried this with windowGainedFocus also, with the same result
public void windowActivated(WindowEvent e)
if (!ignore)
bringFramesToFront();
private void bringFramesToFront()
ignore = true;
Frame[] frames = Frame.getFrames();
for (int i = 0; i < frames.length; i++)
if (frames[i] != this)
frames.toFront();
toFront();
ignore = false;
// even though I called toFront() before setting ignore to false,
// sometimes a new windowGainedFocus event is received after
// this function exits.

The reason they come up in random order is because when you call Frame.getFrames() it returns an array with the order they were (created)? and not the z-order. So you have to remember the z-order yourself.
You can do this using a frame manager. Basically, when you create one of your frames, you register it with the manager. Then anytime you need the z-order, you can ask the frame manager.
When the frame is registered, the frame manager adds it to it's queue of frames, and adds a WindowListener to it. It uses the window listener to listenen for activated, and closed events.
When it hears an activated event, it puts that frame at the front of its queue and pushes the other frames one position back, and when it hears a closed event, it removes that frame from the queue.
So when you want to know the z-order of the frames, ask the frame manager and it will return an array of the items in its queue.
Also, you will need to consider how to handle minimized frames(?). Good luck.

Similar Messages

  • How to set focus order of multiple Component in a Frame

    I have created a Frame with contain some Label, Textfield, Choice and Buttons
    How do set focus order on these Components

    write an implementation of
    import java.awt.*;
    public class PanelFocusTraversalPolicy extends FocusTraversalPolicy
        public Component getComponentAfter(Container container, Component component)
            if(component.equals(cmp1))
                return cmp2;
            if(component.equals(cmp2))
                return cmp3;
            return cmp1;
        public Component getComponentBefore(Container container, Component component)
            //implentation of method
        public Component getDefaultComponent(Container container)
          return cmp1;
        public Component getLastComponent(Container container)
            return cmp3;
        public Component getFirstComponent(Container container)
           return cmp1;
        public PanelFocusTraversalPolicy()
    }and set the focus traversal of frame.
    setFocusTraversalPolicy(new PanelFocusTraversalPolicy())

  • CTM: Difference between Order creation Frame & Maximum earliness

    Hi Experts,
    Could any one please explain me the difference between Order Creation Frame & Maximum Earliness in CTM Gloabl Customizing and their implact on the planning run
    Thanks,
    Naveen

    Hi,
    Order creation frame is a variable planning parameter and has to be set in CTM profile.Using this planning parameter one can define a range within a certain demand has to be fulfilled.In other words a time frame can be set within a supply has to be planned to fulfill a certain demand.
    Maximum Earliness is maintained for Planned Orders which is the time period (in days) before the demand date, within which SAP APO can create planned orders early.
    Thanks,
    Dipankar

  • TS4020 I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    Try this support document for information on how to contact Apple and account security. Apple ID: Contacting Apple for help with Apple ID account security

  • Setting tab order in Acrobat 9

    This is the first time I'm trying to set the tab order in a PDF created in Acrobat 9. I am used to the previous versions where all you had to do was click through the fields to set their order, Adobe seems to have changed it to be much more cumbersome requiring you to drag the fields in the field list. I can see where this might be useful in certain cases, but I would like to still be able to edit the tab order the older way. For larger more complicated documents, it's just much easier to do it this way for me. Is this impossible in newer versions, or am I missing something?
    I tried opening the file in Acrobat 8 on another machine, and the 'Edit Tab Order' command is greyed out for this file, so I'm guessing that editing in 9 must change the file to make it incompatible to edit this way.
    If anyone has any insight on a way to easily edit the tab order in version 9, or to allow the file to be edited in version 8, I would be grateful for any assistance.

    Yes, I do have the Select Object tool active. (The 'Edit Fields' menu option doesn't show up unless that tool is active)
    I have tried to edit the PDF on my Mac and PC, and in both cases, all of the menu options under the 'Edit Fields' menu, including the option to set the tab order, are greyed out.
    I did a quick test and copied the fields into a new document, and the menu was available, so I may be able to get this working by opening a new copy of the original PDF and pasting the fields I have set up into that document. I hope this works, because my estimated time that I will spend rearranging the fields is about 25-30 seconds per field which would equate to about 1-1.5 hours of work just to set the Tab Order!! That's compared to about 2-3 minutes or so (at max 5 minutes). With all of the checkboxes, text fields and combo boxes, there are roughly 250 or so fields on this form.
    Thanks. If you have any other suggestions, let me know.

  • How to set tabbing order in Acrobat X Pro

    I cannot find any instructions for manually setting tabbing order in Acrobat X Pro.  It does not work the same as earlier versions of Acrobat Pro.  Any idea as to where I can go for instructions for X Pro?

    Thank you for the quick response!  I found instructions for the Pro 9 version, so followed that and it worked like a charm.
    Thanks again for your help.
    RJ

  • About setting tab order in Acrobat Pro X

    I'm really disappointed in the way you changed how I set tab order in Acrobat Pro X. I work with a lot of forms with multiple fields. Some of these forms have up to 100 different fields on one page that need to be in the order I set. In previous versions, I could set this order simply by clicking on the fields in the correct order I want. But with X, I have to drag each field one by one into the correct order. When you have a bunch of fields to set, this is tedious. And, when I click on a field to edit content, more times than not, it changes the tab order, and I'm back to finding it in the panel and dragging it back to it's correct place. This is time consuming. Not to mention when there are more fields than the monitor's height, the fields are scrolled in the panel.
    So, please do something to give me the option to set tab order like in previous versions, and once they are set, leave them where they are. Or am I doing something wrong?

    You're not doing anything wrong, it really sucks. But things are improved significantly with Acrobat 11. First, there's a preference setting that prevents the automatic reordering that can happen when fields are moved/edited. Second, you are able to select and move multiple fields at a time in the fields panel, which can speed things up considerably. It's still not as efficient as the old method, but at least it has finally been addressed. I think this feature alone is worth the upgrade price for the amount of time it will save and the beneficial effects on stress, blood pressure, and hair loss.

  • Using Set Break Order property

    Hi,
    I create a Break Group with one column in the Data Model
    Open the Property Palette for the column and the Set Break Order property does not appear. However the Break Order property does appear and its values is asending or descending.
    Here's the definition for this property in Report Bulder Help "The Set Break Order Property is whether to set the order in which to display the column's values, using the Break Order property". This implies that if the Break Order property is set to something other than NONE, the Set Break Order is Yes.
    Another reference I have states " A point to be noted is that all break groups must have at least one column with the Set Break Order set to the Yes value".
    My concern/question is in all of the documentation I have read both properties appear, but only one appears in my environment. Am I doing something wrong? Is there a setting to be change to make both properties appear? I am using Reports 6i, on Win2000 and connected to an Oracle 8i database.
    Thanks in advance,
    Audrey

    Hi,
    This looks to be a documentation mistake. From Reports 3.0.5 onwards, We have removed the Set Break Order Property for columns and just added
    a "None" item to the Break Order property poplist instead. For columns which cannot be break columns, we do not even give the option of changing the Break Order from None to anything else. So just go-on desiging your Report with just one break order property, that is sufficient.
    Thanks,
    Rohit

  • XNET order of frames

    Hi,
    I have some problems with the XNET Write CAN Block. I use a loop for reading Data from CAN via XNET, doing some calculations and lateron sending those via XNET to CAN. I would like to send data at the end of every loop that is why I chose event in the DBC for a trigger. The data is sent to the write block as an array (Signal Input Single Point). Now when I check the order of frames on the CAN-Bus via additional tools (CANALYZER by Vector), the messages come out in random order. The message identifier seems not to have any effect on the order.
    I tried the same setup with cyclic trigger. In this case the order of frames answers to the frame id. But this would lead to timing delay if CAN and my loop don't run synchronous (Windows...).
    Any suggestions? Is this behaviour normal? I thought that the frame id would handle the order if event is triggered for all frames at the same time...
    Thx Jan

    Hello!
    Could you please supply your .vi, or even better, break it down to a minimal example in which I can easily see what you are doing?
    Regards, RomBe

  • How to set exect order sum

    Hellow!
    Sale person need to sale 238 pc of material X.
    If we set price condition = 10,50 then order sum is 2.499,00
    If we set price condition = 10,51 then order sum is 2.501,38
    But customer ask as to set total order sum = 2.500
    How could I manage it ?
    Any condition to correct order sum ?
    Andrey Garshin.

    hi,
    why can't u use DIFF condition type and round off the decimals with prior approval from
    your team lead.
    Cheers,
    Sailesh
    Edited by: sistla sailesh on Mar 27, 2011 7:36 PM

  • Setting in Order Type Dependent Parameters

    Hi Gurus,
    Can anyone tell me the importance of Setting in Order Type Dependent Parameters  ( T.Code OPL8)  -
    setting of purchase requisitions -
    Reservation / purchase requistion - 1, 2  or 3.
    What is the significance?
    Srini

    Hi,
    If it is mainteaind 3 then, if there is any external operation if your production order then the purchase requisition will be created immediately upon creation of the order.
    and the Collective request: Collective purch.req. enables collective purchase requisition per order for externally processed operations or non-stock items.
    Hope this helps..
    Regards,
    Siva

  • Can you set up a key frame on a movie published through iPhoto on .Mac?

    Does anybody know if you can set up a key frame on a movie published through iPhoto on .Mac? I mean the thumbnail for the movie...

    lnbs:
    Welcome to the Apple Discussions. Not in iPhoto. I don't know if you can import the movie into iMovie and set a key frame that way. But that would include some additional encoding to get it out of iMovie and might degrade the quality.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Unable to set tabbing order for a typedef

    Attached is a .CTL file that is for a typedef in my project. I'd like to set the tabbing order. I'm using the "Array to Cluster" VI (is it a VI?) to fill it with data, however because the controls are not in the correct order, the data is no being put in the right place. When I edit my CTL, Edit|Set Tabbing Order is greyed out. Why is this and how do I fix it?
    See my attached file.
    Solved!
    Go to Solution.
    Attachments:
    Accumulated Metrics.ctl ‏19 KB

    Never mind - I figured it out. Right click on the cluster containing my controls and select "Reorder controls in cluster..."

  • Is Set Tab Order Broken in Acrobat 8.x Pro?

    I can't seem to get it to work. Even when the automatic tab order setting is done and it is numbered correctly, when I switch to Preview and also save/close/re-open in Preview, the tab order is what it was before. When I go to Edit Layout, the tab ordering numbering shows correctly for all fields, but back in Preview, it goes out of whack in the same way.

    Yes, I had already tried saving and even closing and re-opening. The Set Tab Order interface does not even operate in a fashion the user would expect. When replying to the alert question about automatic vs. manual setting of the interface, then randomly clicking fields, at one point the order stops changing once a field is selected. A text field becomes the LAST numerical field when it is selected, rather than starting at one and proceeding in ordinal fashion.
    I am convinced that this feature is bug-ridden based on my attempts to work with it and given the numerous posts "commenting" on this very feature.

  • My ipad is disabled and I cannot restore it because the Function Find My Ipad setting was on, and I cannot get in the ipad to turn off the setting in order to restore the ipad. Does anyone know how to solve the problem

    My ipad is disabled and I cannot restore it because the Function Find My Ipad setting was on, and I cannot get in the ipad to turn off the setting in order to restore the ipad. Does anyone know how to solve the problem

    Force iPad into Recovery Mode. Follow step 1 to 5 very closely.
    http://support.apple.com/kb/HT1808
    Note: You may have to repeat the above a few times.

Maybe you are looking for

  • Problem installing HP Photosmart Premium In Bootcamp

    I've had this printer installed under 10.6 and Win 7.  I have a HP Photosmart Premium C310a wireless printer.  I've had it since it was released, oh probably a year ago.  This was configured and worked fine in Win 7 under Bootcamp. With Lion, I try t

  • Multi user use of external hard drive (Time Capsule) mount and permisssions

    I have an iMac (intel, OSX10.6.7) and Time Capsule [TC]. I have set up Time Machine to use the TC. I also use the TC for additional storage - Photos and Music - to keep the iMac drive fairly free. There are 5 users of this setup (2 Admin). The TC is

  • Error starting XL reporter

    Hi All, I have recently upgraded my excel from 2003 to 2007. The excel reporter was working fine. After the upgrade when I am generating the reports the system shows an error An error occured during the process "Report Initialize" Description:666 err

  • Indesign CC Installation problems. ERROR: Media DB Error : 6

    I'm trying to install Indesign CC on a Mac, OS 10.6.8. but the installation is failing. The log shows ERROR: Media DB Error : 6   .  Any suggestions to solve this would be much appreciated.

  • Inserting AP elements

    In DW 3 inserting a nested AP element was done by holding ALT when dragging the element. How is it done with CS4. Each time I click ALT and try to draw my element it doesn't draw and I get the Indicator popping out. I know I can do this just by putti