MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //var/usr/webmin-1.941/bacula-backup/FixedFrame.java
import java.awt.*;
import java.io.*;

public class FixedFrame extends Frame
{
	int mw = 0, mh = 0;

	public FixedFrame()
	{
	Dimension d = Util.tk.getScreenSize();
	double rx = Math.random(), ry = Math.random();
	move((int)((d.width/2)*rx), (int)((d.height/2)*ry));
	}

	public FixedFrame(int w, int h)
	{
	this();
	mw = w; mh = h;
	}

	public boolean handleEvent(Event evt)
	{
	if (evt.target == this && evt.id == Event.WINDOW_DESTROY) {
		dispose();
		return true;
		}
	return super.handleEvent(evt);
	}

	public Dimension minimumSize()
	{
	if (mw != 0 && mh != 0) return new Dimension(mw, mh);
	else return super.minimumSize();
	}

	public Dimension preferredSize()
	{
	return minimumSize();
	}

	public void setFixedSize(int w, int h)
	{
	mw = w; mh = h;
	}
}