Article View: borland.public.jbuilder.java.swing
Article #9401Re: abnormal program termination
From: Alex
Date: Mon, 10 Apr 2000 00:00
Date: Mon, 10 Apr 2000 00:00
66 lines
2624 bytes
2624 bytes
Yep, I'm having the same problem with JBuilder 3.5 Pro on Win NT 4.0 SP5.
Daniel P. Horn <dan@nerds.com> wrote in message
news:8c2tkf$23u1@bornews.borland.com...
> Has anyone else seen this problem?
> Any suggestions for a fix or workaround?
>
> Here's an error that the JBuilder debugger doesn't seem to trap correctly.
>
> I'm running JBuilder 3.5 Enterprise (Trial Edition) on Windows 2000; a 500
> Mhz system with 256 MB RAM.
>
> When I run the following code to bring up a JFileChooser dialog, I get a
> Windows dialog box with the caption
> "Microsoft Visual C++ Runtime Library" that says:
> Runtime Error!
>
> Program: D:\JBuilder35\jdk1.2.2\bin\javaw.exe
>
> abnormal program termination
>
> with an "OK" button.
>
> The code that produces this problem sets a FileFilter
> void jButtonBrowseURIFile_actionPerformed(ActionEvent e)
> {
> JFileChooser chooser = new JFileChooser();
> TextFileFilter textFileFilter = new TextFileFilter();
>
> // Comment out the following line and it all works correctly.
> chooser.setFileFilter(textFileFilter);
> if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
> {
>
jTextFieldURIFile.setText(chooser.getSelectedFile().getName());
> }
> }
>
> // Here's the code for the file filter; note that I have used exactly this
> // code in another Java program:
> class TextFileFilter extends javax.swing.filechooser.FileFilter
> {
> public boolean accept(File f)
> {
> String name = f.getName();
> return (name.endsWith(".txt") || name.endsWith("*.text"));
> }
> public String getDescription()
> {
> return "Text Files (*.text;*.txt)";
> }
> }
>
>
> The problem seems to be with running on Win2000; I just tried an earlier
> Java application that also uses a JFileChooser and ran into a similar
> problem;
> the earlier application always worked fine on NT4 (SP3) and Win98.
>
> If you know of any simple workaround or fix, please let me know.
>
> Thanks,
>
> Dan
>
>
Technical Details
Message-ID:
<38f24b96@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8c2tkf$23u1@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c8df9ec33d6dd9d9 X-Google-Attributes: gid111d45,public From: "Alex" <alexi@cra.com> Subject: Re: abnormal program termination Date: 2000/04/10 Message-ID: <38f24b96@dnews> X-Deja-AN: 609294766 References: <8c2tkf$23u1@bornews.borland.com> X-Trace: 10 Apr 2000 14:45:58 -0800, 199.103.161.2 X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: borland.public.jbuilder.java.swing X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300