Java JFrame saveFrame(Class pClass, JFrame pFrame, String pFrameId)

Here you can find the source of saveFrame(Class pClass, JFrame pFrame, String pFrameId)

Description

save Frame

License

Open Source License

Declaration

public static void saveFrame(Class<?> pClass, JFrame pFrame, String pFrameId) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.prefs.Preferences;
import javax.swing.JFrame;

public class Main {
    public static void saveFrame(Class<?> pClass, JFrame pFrame, String pFrameId) {
        Preferences prefs = Preferences.userNodeForPackage(pClass);
        final String locPrefId = pFrameId + ".location";
        final String szPrefId = pFrameId + ".size";
        String location = pFrame.getLocation().x + ":" + pFrame.getLocation().y;
        String size = pFrame.getSize().width + ":" + pFrame.getSize().height;
        prefs.put(locPrefId, location);/*from ww  w.  j av a 2 s  .c  o  m*/
        prefs.put(szPrefId, size);
    }
}

Related

  1. replaceGlassPane(JFrame frame, Component newGlassPane)
  2. restoreFrame(Class pClass, final JFrame pFrame, String pFrameId)
  3. restoreFrame(JFrame frame)
  4. rightShiftDialog(JDialog dialog, JFrame parent)
  5. run(JFrame frame, int width, int height)
  6. saveMainWindowLocation(JFrame jfrm, String strPropertiesFilePath, String strPropertiesFileName)
  7. setBlockAllUserInput(final JFrame frame, final boolean yesNo)
  8. setCursorFree(JFrame frame)
  9. setDialogLocation(JFrame frame, JFrame parentFrame)