Article View: borland.public.jbuilder.java.swing
Article #9376abnormal program termination
From: Daniel P. Horn
Date: Fri, 31 Mar 2000 00:00
Date: Fri, 31 Mar 2000 00:00
59 lines
2341 bytes
2341 bytes
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:
<8c2tkf$23u1@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c8df9ec33d6dd9d9,start X-Google-Attributes: gid111d45,public From: "Daniel P. Horn" <dan@nerds.com> Subject: abnormal program termination Date: 2000/03/31 Message-ID: <8c2tkf$23u1@bornews.borland.com> X-Deja-AN: 604970082 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing