Minimizing(Iconifying) all JFrames when main window is minimized?

I have a main windows that is a JApplet. It has many subwindows that are JFrames. I want to make it so that all the open JFrames minimize when I minimize the main JApplet and deiconify when the main JApplet is deiconified.

Knocking this up!

Similar Messages

  • C# MDI application: how to scale child windows when main window is re-sized?

    Hi,
    I have an MDI application that have several child forms.  Users can view several forms at one time, and users also are given the options to arrange the child forms anyway they want:  cascade or tile.  What I want to achieve is that if the
    parent window is re-sized, all child forms should also be re-sized proportionally.   The code that I have only work if the child forms are tiled horizontally, AND that I only make the main window wider.  Otherwise, all forms are scaled (but not perfect),
    however, the location is not scaled; therefore, they are overlapping each other.   I greatly appreciate any help from you.  
    Size m_preSize;
    private void MainForm_ResizeBegin(object sender, EventArgs e)
    m_prevSize = this.ClientRectangle.Size;
    private void MainForm_ResizeEnd(object sender, EventArgs e)
    int iWidth = m_prevSize.Width;
    int iHeight = m_prevSize.Height;
    double dXFactor = (double)(this.ClientRectangle.Width) / (double)iWidth;
    double dYFactor = (double)(this.ClientRectangle.Height) / (double)iHeight;
    foreach (Form c in this.MdiChildren)
    if (!c.Visible)
    continue;
    if (c.WindowState == System.Windows.Forms.FormWindowState.Maximized ||
    c.WindowState == System.Windows.Forms.FormWindowState.Minimized)
    // DO not ajust on resize if a child window is at its Maximized state
    return;
    c.Scale(new SizeF((float)dXFactor, (float)dYFactor));
    Best Regards,
    Emily

    Hi Badidea,
    Once again, I did not explain my idea clearly.  I am sorry about that.  I only wanted to scale the child-windows as the parent re-sized.  And yes, if the child-windows fill up the view-able area of the parent's window, I would like them to
    also fill up the  view-able area of parent's window once again after re-size of parent window.  No scroll should be involved.
    Regards,
    Emily
    Hello,
    It depends on how you cascade or tile these forms.
    In this case, I would recommend you use this way below.
    1. Layout with splitContainers.
    2. Set each child form's toplevel to false, then add them to the panels of splitContainers.
    3. Resize these form to fit the panels.
    4. repeat #3 inside the main form's resize event.
    Here is a simple sample.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace _150313AutoSizeMdiChiledForm
    public partial class MainForm : Form
    public MainForm()
    InitializeComponent();
    Form1 f1 = new Form1();
    Form2 f2 = new Form2();
    Form3 f3 = new Form3();
    private void MainForm_Load(object sender, EventArgs e)
    f1.TopLevel = false;
    this.splitContainer2.Panel1.Controls.Add(f1);
    f1.Size = this.splitContainer2.Panel1.ClientSize;
    f1.Show();
    f2.TopLevel = false;
    this.splitContainer2.Panel2.Controls.Add(f2);
    f2.Size = this.splitContainer2.Panel2.ClientSize;
    f2.Show();
    f3.TopLevel = false;
    this.splitContainer1.Panel2.Controls.Add(f3);
    f3.Size = this.splitContainer1.Panel2.ClientSize;
    f3.Show();
    private void MainForm_Resize(object sender, EventArgs e)
    f1.Size = this.splitContainer2.Panel1.ClientSize;
    f2.Size = this.splitContainer2.Panel2.ClientSize;
    f3.Size = this.splitContainer1.Panel2.ClientSize;
    Designer code.
    namespace _150313AutoSizeMdiChiledForm
    partial class MainForm
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    if (disposing && (components != null))
    components.Dispose();
    base.Dispose(disposing);
    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    this.splitContainer2 = new System.Windows.Forms.SplitContainer();
    ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
    this.splitContainer1.Panel1.SuspendLayout();
    this.splitContainer1.SuspendLayout();
    ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
    this.splitContainer2.SuspendLayout();
    this.SuspendLayout();
    // splitContainer1
    this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
    this.splitContainer1.Location = new System.Drawing.Point(0, 0);
    this.splitContainer1.Name = "splitContainer1";
    this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
    // splitContainer1.Panel1
    this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
    this.splitContainer1.Size = new System.Drawing.Size(607, 411);
    this.splitContainer1.SplitterDistance = 198;
    this.splitContainer1.TabIndex = 0;
    // splitContainer2
    this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
    this.splitContainer2.Location = new System.Drawing.Point(0, 0);
    this.splitContainer2.Name = "splitContainer2";
    this.splitContainer2.Size = new System.Drawing.Size(607, 198);
    this.splitContainer2.SplitterDistance = 294;
    this.splitContainer2.TabIndex = 0;
    // MainForm
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(607, 411);
    this.Controls.Add(this.splitContainer1);
    this.Name = "MainForm";
    this.Text = "MainForm";
    this.Load += new System.EventHandler(this.MainForm_Load);
    this.Resize += new System.EventHandler(this.MainForm_Resize);
    this.splitContainer1.Panel1.ResumeLayout(false);
    ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
    this.splitContainer1.ResumeLayout(false);
    ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
    this.splitContainer2.ResumeLayout(false);
    this.ResumeLayout(false);
    #endregion
    private System.Windows.Forms.SplitContainer splitContainer1;
    private System.Windows.Forms.SplitContainer splitContainer2;
    Result.
    You could download it form http://1drv.ms/1Mwwibp.
    It is quite similar with the one for tiling, you could edit it to fit your requirements.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Extra boxes when Main Window Overflows

    Hi All,
      I created a table in Main Window, after that i have long texts. If the long text overflows, then i am getting two boxes which are not even present in the form anywhere. I am wondering how to get rid of those two extra boxes. Please help me.
    Thanks,
    Kumar

    Hi Kumar,
    Elobrate it a bit more.
    I couldn't visualize what do you mean by extra box, where exactly they are...before the table/ after the table.
    or extra boxes in one coulm of the table.
    cheers,
    Sai

  • Smart Forms: No next page when MAIN-Window is full

    Hi you SmartForms-Experts,
    i've got a SmartForm for Purchase Order. This SmartForm breaks with a error message when the MAIN-window on page "FIRST" is filled up and some more positions should appear in the MAIN-window on page "NEXT".
    The following page for page "FIRST" is "NEXT" and the following page for page "NEXT" is "NEXT".
    The printing program is a customer-copy of SAPFM06P, entry is "ENTRY_NEU".
    There is another window that is to be processed at the end of MAIN-window. I first thaught, that this is the problem, but it doesn't matter if it is deleted oder processed "before end" of the MAIN-window oder "after end".
    I debugged my smartform several times, but only saw the errors occur and did not recognize why.
    MAIN-window has got the same width on page "FIRST" and on page "NEXT".

    Hi Aidan,
    thank you for your answer. I solved the problem yesterday in the late evenening. It was similiar to your answer.
    There are some other windows in my smartform besides of "MAIN" that are copied from page "FIRST" to "NEXT".  One of them was smaller (width) than the original on first page. And therefore it could not be processed.
    I learned: Never change another programmers Smartform, even he left the company three years ago. Try to make your own Form.
    Thanks
    Franz

  • How to get all JFrames in one window.

    I have a JFrame with menu system. When the user opens a file using the menus and filechoosers,another JFrame is called wherein the required output is displayed. If another file is chosen,the data of the previous file is not cleared from the runtime memory. What additional statement is needed to debug this program?
    Also on clicking the second menu and the menuitems therein,each JFrame instance is created with the required outputs. How to make all these JFrame instances in a single window? I tried the JDesktopPane but with no success.

    JFileChooser jfc = new JFileChooser();
    JMenuBar jmb = new JMenuBar();
    JMenu jm1 = new JMenu("File");
    JMenu jm2 = new JMenu("Plot");
    JMenuItem jmi1 = new JMenuItem("Open Alt+O",new ImageIcon("Open.gif"));
    JMenuItem jmi2 = new JMenuItem("Exit");
    JMenuItem jmi3 = new JMenuItem("Graph");
    public void actionPerformed(ActionEvent ae){
         if (ae.getSource()==jmi1){
              int result = jfc.showOpenDialog(null);
              File file = jfc.getSelectedFile();
              String ftr = file.toString();
              System.out.println("The file selected is "+ftr);
              ftr.trim();
              if (result == JFileChooser.APPROVE_OPTION){
                   try{
                        RandomAccessFile raf = new RandomAccessFile(ftr,"r");
                        long l = 0;
                        while (l < raf.length()){
                             String str = raf.readLine().toString();
                             l = raf.getFilePointer();
                   jm2.setEnabled(true);
                   frame("Frame");
                   raf.close();
              }catch (Exception e){
                   System.out.println("Exception caught is "+e.toString());
         }else if (result == JFileChooser.CANCEL_OPTION){
              jfc.cancelSelection();
         }else if (ae.getSource()== jmi2){
              System.exit(0);
         }else if (ae.getSource()== jmi3){
              graph("Graph");
    static void frame(String title){
         JFrame frame = new JFrame(title);
         frame.getContentPane().add(new GraphPanel(), BorderLayout.CENTER);
         frame.setDefaultCloseOperation(2);
         frame.pack();
         frame.setVisible(true);
    static void graph(String title){
         JFrame frame = new JFrame(title);
         frame.getContentPane().add(new Graph(), BorderLayout.CENTER);
         frame.setDefaultCloseOperation(2);
         frame.pack();
         frame.setVisible(true);
    Whre should I use frame.setVisible(false); and frame.dispose();

  • How do you set default programs for all users when deploying Windows 8.1?

    I have my Windows 8.1 image set up the way I want including the start screen, theme, etc. But how can I set the default programs for all users. Most of out computers are non-touch and I want the desktop apps (e.g. Windows Photo Viewer), not the store apps
    to be the default for opening pictures, videos, etc. Can that be done?

    Great question, this has been bugging me too!
    So, I did some research by using "Set Default Programs" app in Windows 8. Then I ran the super ProcMon.exe tool from Sysinternals.com <Thanks Mark!>
    After filtering out the junk, I could see some *interesting* writes to the registry:
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserChoice]
    "Hash"="57y87/ogggU="
    "ProgId"="PhotoViewer.FileAssoc.Jpeg"
    But the "Hash" part had me concerned. I did some internet searching for the hash, and came across a post and a pointer to a blog with some answers.  This is both good news and bad.
    Background:
    One of the problems with Windows XP is that any program can come in and party on the entire system. No, I don't want you to put a shortcut on the desktop, install a crappy IE Toolbar, and change the default file association for *.jpg files to your app, I
    just wanted to play a stupid game. Since Windows 7, Microsoft has been attempting to block that functionality from the stupid applications, and give them back to the user. Take note of the last line in the ITaskbarList3 interface:
       Applications cannot programmatically pin themselves to the taskbar. That functionality is reserved strictly for the user.
    Of course that sucks for us IT Pros who may wish to create *default* working environments for corporate images, but there are some tricks we can do.
    Solution:
    This blog appears to have the answer:
    http://blogs.technet.com/b/mrmlcgn/archive/2013/02/26/windows-8-associate-a-file-type-or-protocol-with-a-specific-app-using-a-gpo-e-g-default-mail-client-for-mailto-protocol.aspx
    New for Windows 8 is a dism command: /Get-DefaultAppAssociations that allows you to export a control case from a known good computer. Microsoft the supports importing the exported xml file via GPO. For example, before I changed the file association, .AVI
    was pointing to the Modern App, after the change the /export-DefaultAppAssociations shows change to the new app:
    From:
    <Association Identifier=".avi" ProgId="AppXhjhjmgrfm2d7rd026az898dy2p1pcsyt" ApplicationName="Video" />
    To:
    <Association Identifier=".avi" ProgId="VLC.avi" ApplicationName="VLC media player" />
    I am still doing some investigation to see if a GPO is required, or if you can inject the association into a local user account. Also, if you do have some Modern Windows 8 Touch Tablets, it would recomend keeping most of the Modern App defaults in place,
    perhaps seperate GPO's for Desktops/Laptops vs Tablets?
    -k
    Keith Garner - keithga.wordpress.com

  • Opmn does not start all processs when server ( windows 2003 is rebooted ).

    There is a startup script which starts every process when run from cmd. But when the server is rebooted it does not start Portal, WebCache.
    The startup Script :
    @ECHO OFF
    REM ---------------------------------------------
    REM 10gAS Rel 2 Midtier startup script
    REM ---------------------------------------------
    date /t
    time /t
    REM ----------------------------------
    REM Set Oracle Home
    REm -----------------------------------
    set ORACLE_HOME=d:\Oracle\Ora10gMid
    set PATH=%ORACLE_HOME%\bin;%ORACLE_HOME%\dcm\bin;%ORACLE_HOME%\opmn\bin;%PATH%;
    REM ----------------------------------
    REM startup ProcessManager (OPMN)
    REM ----------------------------------
    REM call %ORACLE_HOME%\opmn\bin\opmnctl startall
    call %ORACLE_HOME%\opmn\bin\opmnctl start
    call %ORACLE_HOME%\opmn\bin\opmnctl startproc ias-component=WebCache
    call %ORACLE_HOME%\opmn\bin\opmnctl startproc ias-component=OC4J
    REM call %ORACLE_HOME%\opmn\bin\opmnctl startproc process-type=WebCacheAdmin
    REM call %ORACLE_HOME%\opmn\bin\opmnctl startproc process-type=home
    REM call %ORACLE_HOME%\opmn\bin\opmnctl startproc process-type=OC4J_BI_Forms
    REM call %ORACLE_HOME%\opmn\bin\opmnctl startproc process-type=OC4J_Portal
    REM call %ORACLE_HOME%\opmn\bin\opmnctl startproc process-type=HTTP_Server
    REM call %ORACLE_HOME%\opmn\bin\opmnctl startproc ias-component=Discoverer
    ======================================================
    I tried starting each process type individually and it does not start OC4J and WebCache components. This does not work only during reboot.
    Thanks in advance for our valuable suggestions
    v

    no bat file is needed for opmn to startall on service restart or system reboot. Opmn remembers the state of the services on a clean shutdown of the service & will bring it back. So just do a opmn startall, then restart the Oracle<OraHome>ProcessManager service & check using opmn status. All services should be in the same state as before the Oracle<OraHome>ProcessManager was restarted.
    where/why are you trying to use a bat file to stopall/startall? It can be done via a script, but the user that starts the bat file MUST be the same user that installed OAS/OID.

  • Wanted Main window only on Task bar ...Need help as soon as possible

    Hello All,
    We are creating one application.
    We have main window(JFrame) with four subwindows.
    By clicking buttons on main window the subwindows will be opened.
    By using Iconified method we are able to minimise all the subwindows when main window is minimised.
    But on the task bar all the windows are showed.
    But we want to show main window only on the task bar while minimising
    That means all the sub windows should come under main window.
    Will Deiconified satifies this condition while maximisation.
    Need some ones help.
    Thank You All.
    Rajiv.V

    Use show() and hide() on your subwindows instead of iconifying and deiconifying them. Minimizing a window should produce exactly the behavior you're seeing. Using the right tool will get you the right result.

  • How to make text elements flow to next page depending on the table above it in main window (smart forms)

    Hi all,
    In my main window i have a table that contains line item data.
    Just below that i need to display text elemet (some text and terms & conditions).
    as below
    Based on the items in table, it should flow to next page. But it is not happening. rather the data which do not fit into first page gets deleted.
    Please help to solve this. Its urgent.
    Thanks in advance

    Hi Rashmi,
    please drop these texts from your table footer (i hope you have put into footer of your table), just create a template after your table and  put your all these data within this template and make sure that your this
    template should be called after your tables data get displayed.
    Or you can create a text , after your table where you put your data, and it should get displayed when the line items ends for your table.

  • **To branch to a new page in Smart forms after main window**

    I have three pages where on second pages main window so my data many be carry on next 3, 4, pages and my requirement is to display  data(like notes ) on last page after all contain of main window .that last  third page is different formatting on basis of company code lets 10 different pages. On second page in main window I write u2018commandu2019 and General Attributes, Tick Go to new page in. On the Determine the new page using the list box next to the checkbox. The output of the main window will continues on the new page of third pages. I did this for my all company like (command for 10 , command for 11u2026.).BUT also on second page option of next page in General Attributes. Where in can maintain next pages entry is single...if I put blank the error comesu2026thingu2019s 1) what should I have to maintain in second page for next page.
    2) how I get data from multiple page design (I design 10 pages from that I want one should display):- I used condition option in command for company still getting error .
    So kindly help me  for such scenario.
    Edited by: nshahare on Aug 5, 2011 4:07 PM

    Hi nshahare ,
    Format the way you have asked the question, It is highly unclear what issue you are facing.
    Be clear, be cool and then post(edit) the question again. we are here to help you.
    BR
    Dep

  • SAPSCript how to print  a comment at the end of main window on first page?

    In SAP Scripts, How do I print a comment at the end of the first page (I have several pages of data) in the main window?
    - Ven

    hi
    good
    yes we can put condition.....to display the footer window get printed after all data in main window gets over.........................assingn u r footer window to next page [ i.e u r second page] ...and write the condition
    In such senario no need to use a window for footer.
    In the Script form:
    -> In the Main Window itself after all the main data create an Element.
    -> Use BOTTOM and END-BOTTOM; write your footer information between them.
    In your Driver Program:
    -> After printing all the data (means after passing to form and before closing the form) call one WRITE-FORM with the footer element.
    I'm sure it will work.
    f u r not interested to change the print program. Then simply insert simple code in the footer wondow.
    now insert this code in ur footer window
    IF &TTXSY-PAGE& = &SAPSCRIPT-FORMPAGES&.
    *all code in footer goes here.
    ENDIF.
    &TTXSY-PAGE& holds the page number of current page.
    &SAPSCRIPT-FORMPAGES& holds total form pages.
    This will work.
    write this code then the footer will be printed in last page itself
    /: IF &NEXTPAGE& EQ 0
    whatever footer you want.
    /: ENDIF
    You need to create an element in the MAIN window. You can do it in two ways:
    1. In SE71, you can create:
    /:E FOOTER
    /:BOTTOM
    Text
    /:ENDBOTTOM
    In the print program, just call this element.
    2. In you print program, populate parameter type = BOTTOM in FM, WRITE_FORM.
    Ex.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    element = 'FOOTER'
    type = 'MAIN'
    window = 'BOTTOM'
    EXCEPTIONS....
    However, if you issue new page having new header data. Thus, new item data. And if it will exceed more than 1 page, the footer will still appear. To solve this, you need to create a new element in MAIN. Ex. INIT_FOOTER. It just contains the following:
    /:E INIT_FOOTER
    /:BOTTOM
    /:ENDBOTTOM
    Call this after passing all item data.
    reward point if helpful.
    thanks
    mrutyun^

  • When I open a separate window and start private browsing my main window closes and I lose all of my app tabs

    whenever I open a new window and do private browsing it closes my main window and I loose all of my app tabs. If this is functioning as designed then it is a flaw in the design.

    It is designed that way. When you stop private browsing, all of your other tabs will come back.

  • Stopping the applications main window from activating when a child window is clicked

    I am building a javascript based AIR application that implements a bastardized growl notifier.  When the the application is minimized or in the background you may be notified of a new message.  This part works great.
    The UI calls for an "X" button to close the the notification window.  When I click the "X" the application's main window is activated and brought to the foreground, but the desired behavior is that the main application window stays minimized or backgrounded.  I've tried playing around with preventDefault and stopPropagation on mouse click and mouse down events but this doesn't seem to solve the problem.  I've also tried to hook into the display state changing event on the nativeWindow to see if I could cancel activation events in this scenario but I wasn't able to get that to work.  My last ditch effort was to try and tap into the AIR platform events for mouse click and mouse down, with the rationale that these things are handled in AIR and by the time it gets to the webkit engine, it's already too late, but that didn't seem to work either.
    It's completely possible that I'm "missing some mundane detail" and one of these approaches should be sufficient.  I've noticed that TweetDeck has the same problem so I'm wondering, is this just an "AIR thing", possibly a bug, or is this expected?
    Any help would be greatly appreciated.  I can post more information and screenshots if my explanation wasn't clear enough.  Thanks for reading.

    sloppy code
    JMenuitem open;
    public actionperformed(event e)
    if e.getsource == open
    displayframe();
    public void displayFrame(){
    JFrame = new jframe
    frame.pack()
    frame.show()
    }

  • Smart forms- when i print a report it print main window data on same page

    hi,
    when i print a report it print main window data on same page .
    i.e. if data is more then one page then it shows data page wise on computer screen but when i print it print all data on same only one page by over wrriting .
    pl. help why it is happening
    i create page in page i set next page and in second page give first page.
    mukesh

    mukesh,
    what happened to this: smart form
    close that please.
    by the way,did you tried with what i suggested?
    lets say mainwindow in 1st page.
    copy the first page to second page.
    now.
    for 1st page: next page is : page2
    for page2: next page is also : page2

  • Firefox main window goes black and all tools disappear.

    Occasionally the Firefox main window will go black and all tools disappear.
    It ends up with a black window, a blue frame, and the three buttons in the top right corner (minimize, maximize and close). If any audio (or video) is playing, the sound continues. If I click the X at top right to close it, it closes and when I restart it everything is ok. See the screenshot below.
    This only happens once a day or so. I have no way of predicting it other than I'm usually scrolling down the page when it happens. It has happened in safe mode.
    I'm using the most recent Firefox, 33.0.2, on Win 8.1 on an i5 system with 8G RAM.
    <img src="http://i.imgur.com/Awx1fD0.png"/>

    Try to disable OMTC and leave hardware acceleration in Firefox enabled.
    *layers.offmainthreadcomposition.enabled = false
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config
    You can try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    You need to close and restart Firefox after toggling this setting.
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://support.mozilla.org/kb/upgrade-graphics-drivers-use-hardware-acceleration

Maybe you are looking for