Article View: borland.public.jbuilder.java.language
Article #19861Re: Storing User Settings/Resolution
From: rudnicki
Date: Sat, 29 Nov 1997 00:00
Date: Sat, 29 Nov 1997 00:00
44 lines
1604 bytes
1604 bytes
> ... I would like to have an application I am working on with JBuilder
> store user settings in either a INI file or the registry. Does Java have
> anything to automate this process. Also is there a way in java to get the
> screen resolution?
1. INI files and the registry are platform dependent. Without using
native code don't try it.
Think Serialization.
2. The snip below pops a dialog box centered on the screen.
bye,
Jim
void Info_mouseClicked(MouseEvent e)
{
Container f = getParent();
while(f != null && !(f instanceof Frame))
{
f = f.getParent();
}
if (f == null)
return;
AboutBox about = new AboutBox((Applet)this, (Frame)f, "About..",
false);
//Center the window
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = about.getSize();
if (frameSize.height > screenSize.height)
frameSize.height = screenSize.height;
if (frameSize.width > screenSize.width)
frameSize.width = screenSize.width;
about.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
about.setVisible(true);
return;
}
Technical Details
Message-ID:
<3481183E.42B2@best.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<65p561$eo4@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,8c249087c8fc0960 X-Google-Attributes: gidf74b3,public From: rudnicki@best.com Subject: Re: Storing User Settings/Resolution Date: 1997/11/29 Message-ID: <3481183E.42B2@best.com> X-Deja-AN: 293840254 References: <65p561$eo4@forums.borland.com> Organization: None Newsgroups: borland.public.jbuilder.java.language