🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#9371
From: James Cook
Date: Thu, 30 Mar 2000 00:00
13 lines
1002 bytes
Sweder Schellens <sweder.schellens@qa-systems.com> wrote in message
news:8bvo8t$2884@bornews.borland.com...
> Dear reader,
>
> How can I detect which button was actually pressed?
>
> I'm looking forward to your reply.

if (chooser.showOpenDialog() == JFileChooser.APPROVE_OPTION) {
    // the non-cancel button was pressed. "Open" button in this case.
}

jim
Technical Details
Message-ID: <38e37099.0@news.dot.state.oh.us>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8bvo8t$2884@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,bc569ed1731373fa
X-Google-Attributes: gid111d45,public
From: "James Cook" <jimcook.spaminator@remove.for.spam.iname.com>
Subject: Re: JFileChooser: how can I detect invalid selection when pressing 'open'-button
Date: 2000/03/30
Message-ID: <38e37099.0@news.dot.state.oh.us>
X-Deja-AN: 604415946
References: <8bvo8t$2884@bornews.borland.com>
X-Trace: 30 Mar 2000 10:19:53 -0500, dotfw001-dmz.dot.state.oh.us
X-MSMail-Priority: Normal
X-Priority: 3
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300