Article View: borland.public.jbuilder.java.swing
Article #8080Swing/AWT crashes
From: MWillis
Date: Thu, 23 Nov 2000 00:00
Date: Thu, 23 Nov 2000 00:00
62 lines
2442 bytes
2442 bytes
Hi
I'm using JB4 Pro on a Win2K machine. Whenever I run a program which makes
a reference to swing or awt components, JB4 crashes with the error:
"java.exe has generated errors and will be closed by Windows. You will need
to restart the program. An error log is being created."
Running the _exact_ same program in JPadPro 3.7 produces no errors at all.
Has anyone had the same problem or has any idea what is causing the fault?
I have included the source code below, minus the package declaration (which
JB4 inserts).
Thanks,
Mark
----------------------------------------------------------------------------
--
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class HelloWorld
{
private JFrame myFrame;
private JPanel myPanel;
private JButton myButton1;
private JTextArea myTextArea;
public static void main (String[] args)
{ HelloWorld hw = new HelloWorld();
}
public HelloWorld()
{ guiInitialise();
}
private void guiInitialise()
{ myFrame = new JFrame ("Hello World Demo"); /*Program
crashes at this point*/
myPanel = new JPanel();
myButton1 = new JButton("Hello World");
myTextArea = new JTextArea(20, 40);
myButton1.addActionListener (new ActionListener(){
public void actionPerformed (ActionEvent e){
myTextArea.setText ("");
myTextArea.setText ("Hello World");
}
});
myPanel.setLayout(new BorderLayout());
myPanel.add(myButton1, BorderLayout.NORTH);
myPanel.add(myTextArea, BorderLayout.CENTER);
myFrame.getContentPane().add(myPanel);
myFrame.setSize(200, 200);
myFrame.show();
}
}
Technical Details
Message-ID:
<8vjia9$egb$1@soap.pipex.net>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,d95754e92c9652b3,start X-Google-Attributes: gid111d45,public From: "MWillis" <markwillis75@hotmail.com> Subject: Swing/AWT crashes Date: 2000/11/23 Message-ID: <8vjia9$egb$1@soap.pipex.net> X-Deja-AN: 697120916 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Complaints-To: abuse@uk.uu.net X-Trace: soap.pipex.net 974998665 14859 194.216.140.22 (23 Nov 2000 16:57:45 GMT) Organization: UUNET WorldCom server (post doesn't reflect views of UUNET WorldCom X-MSMail-Priority: Normal NNTP-Posting-Date: 23 Nov 2000 16:57:45 GMT Newsgroups: borland.public.jbuilder.java.swing