🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11793

Puzzling focus issue - advanced question

#11793
From: kerbel
Date: Wed, 24 Mar 1999 00:00
25 lines
1561 bytes
Please could someone help me...

I'm currently developing a text editor in Swing. I have implemented
the main functionality as a series of actions which are situated in
the menus and toolbars. 

The problem occurs when the main frame of the application loses the
focus. When the focus is not within my application, and the user
presses one of the toolbar buttons a null pointer exception is thrown.
I have pinpointed the cause of this to be the fact that the pressed
button is supposed to display a dialog whose parent component is the
main frame of the application. Since this frame does not have the
focus, a nullPointerException is thrown and the GUI locks up. I have
attempted to put a mainFrame.requestFocus() statement at the start of
each of the actions, but this has not helped.

Please could someone with some advanced experience comment on this and
advise me accordingly.

Many thanks in advance
Uri Kerbel
--
uri@kalbi.demon.co.uk
www.kalbi.demon.co.uk
--
Technical Details
Message-ID: <36f959ba.1812600@news.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,67d598dc0cc2445c,start
X-Google-Attributes: gid111d45,public
From: kerbel@kalbi.demon.co.uk
Subject: Puzzling focus issue - advanced question
Date: 1999/03/24
Message-ID: <36f959ba.1812600@news.demon.co.uk>
X-Deja-AN: 458671622
X-NNTP-Posting-Host: kalbi.demon.co.uk:158.152.128.133
X-Trace: news.demon.co.uk 922312731 nnrp-12:29079 NO-IDENT kalbi.demon.co.uk:158.152.128.133
Reply-To: kerbel@kalbi.demon.co.uk
Newsgroups: borland.public.jbuilder.java.swing
X-Complaints-To: abuse@demon.net