List of usage examples for javax.swing JInternalFrame getGraphicsConfiguration
public GraphicsConfiguration getGraphicsConfiguration()
From source file:com.tag.FramePreferences.java
@SuppressWarnings("serial") public FramePreferences(final JInternalFrame frame, String pathName) { setFrame(new Frame() { @Override//from w w w.j a va 2s .c o m public synchronized int getExtendedState() { if (frame.isMaximum()) { return Frame.MAXIMIZED_BOTH; } else if (frame.isIcon()) { return Frame.ICONIFIED; } else { return Frame.NORMAL; } } @Override public synchronized void setExtendedState(int state) { try { switch (state) { case Frame.MAXIMIZED_HORIZ: case Frame.MAXIMIZED_VERT: case Frame.MAXIMIZED_BOTH: frame.setMaximum(true); break; case Frame.ICONIFIED: frame.setIcon(true); break; case Frame.NORMAL: frame.setIcon(false); frame.setMaximum(false); break; } } catch (PropertyVetoException e) { e.printStackTrace(); } } @Override public synchronized void addWindowStateListener(final WindowStateListener l) { final Frame source = this; frame.addInternalFrameListener(new InternalFrameAdapter() { @Override public void internalFrameIconified(InternalFrameEvent e) { l.windowStateChanged(new WindowEvent(source, WindowEvent.WINDOW_ICONIFIED)); } @Override public void internalFrameDeiconified(InternalFrameEvent e) { l.windowStateChanged(new WindowEvent(source, WindowEvent.WINDOW_DEICONIFIED)); } }); } @Override public synchronized void removeWindowStateListener(WindowStateListener l) { super.removeWindowStateListener(l); } @Override public GraphicsConfiguration getGraphicsConfiguration() { return frame.getGraphicsConfiguration(); } public Point getLocation() { return frame.getLocation(); } @Override public void setLocation(Point p) { frame.setLocation(p); } @Override public Dimension getSize() { return frame.getSize(); } @Override public void setSize(Dimension size) { frame.setSize(size); } @Override public synchronized void addComponentListener(ComponentListener l) { frame.addComponentListener(l); } @Override public synchronized void removeComponentListener(ComponentListener l) { frame.addComponentListener(l); } }); setPathName(pathName); }