🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1088

Re: java.util.prefs

#1088
From: Konstantin Kladko
Date: Fri, 14 Jun 2002 00:13
65 lines
3591 bytes
Hernan - AWT uses preferences to get preferred input
method.

What you must do, is to use

java -Djava.util.prefs.PreferencesFactory=yourfactory

Then everything should be OK.

Konstantin Kladko
Tools/Libraries group, Sun Microsystems

Hernan Silberman <hsilberm@pdi.com> wrote in message news:<3CF7CA1C.3010803@pdi.com>...
> Hi there.
> 
> I've written a custom Preferences implementation for my Java 1.4 
> application which uses a relation database as a backing store.  During 
> the app's startup, I make this known to the app by setting the 
> appropriate sysyem property:
> 
> System.getProperties().
> setProperty("java.util.prefs.PreferencesFactory",
> "com.dw.util.prefs.MyPreferencesFactory");
> 
> I noticed that if my app attempted to bring up any UI before this system 
> property is set, the default (linux or windows) preferences 
> implementation would beat mine to the punch.  My system preference gets 
> set, but it's too late, another preferences implementation has beat mine 
> to the punch because some other entity requested a preference node.
> 
> The real problem is that I need to identify and authenticate my user 
> before I can build the "user root" Preferences node.  To do this, I 
> bring up a login dialog.  For some reason, bringing up the dialog 
> results in a call PreferencesFactory.userRoot().  I don't understand 
> this--why would AWT want to have anything with java.util.prefs?
> 
> This stack trace tells the story.  I'm simply trying to show a splash 
> screen and sun.awt.im.ExecutableInputMethodManager makes a getUserRoot() 
> call before I'm ready for it:
> 
> at java.util.prefs.Preferences.userRoot(Preferences.java:341)
> at 
> sun.awt.im.ExecutableInputMethodManager$2.run(InputMethodManager.java:785)
> at java.security.AccessController.doPrivileged(Native Method)
> at 
> sun.awt.im.ExecutableInputMethodManager.getUserRoot(InputMethodManager.java:783)
> at 
> sun.awt.im.ExecutableInputMethodManager.<init>(InputMethodManager.java:274)
> at sun.awt.im.InputMethodManager.getInstance(InputMethodManager.java:138)
> at sun.awt.windows.WFramePeer.<init>(WFramePeer.java:148)
> at sun.awt.windows.WToolkit.createFrame(WToolkit.java:331)
> at java.awt.Frame.addNotify(Frame.java:469)
> at java.awt.Window.addNotify(Window.java:390)
> at java.awt.Window.show(Window.java:433)
> at java.awt.Component.show(Component.java:1128)
> at java.awt.Component.setVisible(Component.java:1083)
> at com.dw.nile.app.ui.SplashWindow.<init>(SplashWindow.java:90)
> at com.dw.nile.app.ui.SplashWindow.<init>(SplashWindow.java:26)
> at com.dw.nile.app.NileClientApp.appInit(NileClientApp.java:78)
> 
> 
> Any insight is much appreciated.
> 
> thanks...
> hernan
Technical Details
Message-ID: <2db6ad14.0206131613.6dc6f0e6@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
References: <3CF7CA1C.3010803@pdi.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,fc0a371a6415b94a
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-06-13 17:13:05 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: Konstantin.Kladko@sun.com (Konstantin Kladko)
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: java.util.prefs
Date: 13 Jun 2002 17:13:05 -0700
Organization: http://groups.google.com/
Lines: 65
Message-ID: <2db6ad14.0206131613.6dc6f0e6@posting.google.com>
References: <3CF7CA1C.3010803@pdi.com>
NNTP-Posting-Host: 192.18.42.10
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1024013585 30764 127.0.0.1 (14 Jun 2002 00:13:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 14 Jun 2002 00:13:05 GMT