🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

JFileChooser: how can I detect invalid selection when pressing 'open'-button

#9369
From: Sweder Schellens
Date: Thu, 30 Mar 2000 00:00
15 lines
1108 bytes
Dear reader,

I'm using a javax.swing.JFileChooser to browse my harddisk.
I want to issue a warning message when the user presses the 'open'-button
without actually selecting a file.
The JFileChooser treads this as if the 'Cancel'-button was pressed. So, now
the warning also appears when the user presses the 'Cancel'-button.
What should I do?
How can I detect which button was actually pressed?

I'm looking forward to your reply.

Thank you in advance.

Sweder Schellens
Technical Details
Message-ID: <8bvo8t$2884@bornews.borland.com>
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,bc569ed1731373fa,start
X-Google-Attributes: gid111d45,public
From: "Sweder Schellens" <sweder.schellens@qa-systems.com>
Subject: JFileChooser: how can I detect invalid selection when pressing 'open'-button
Date: 2000/03/30
Message-ID: <8bvo8t$2884@bornews.borland.com>
X-Deja-AN: 604354508
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: QA Systems Technologies B.V.
X-MSMail-Priority: Normal
Reply-To: "Sweder Schellens" <sweder.schellens@qa-systems.com>
Newsgroups: borland.public.jbuilder.java.swing