From: Ares <hop...@f2...> - 2008-09-30 07:31:20
|
The following code compiles & runs OK on the java development environment (jdk) but gives the error shown below when compiled by gcj running in mingw : Java code : /* * Trial2.java */ import java.awt.*; import javax.swing.*; public class Trial2 extends JFrame{ JTextArea textArea=new JTextArea(2,20); public Trial2(){ super("Trial 2"); setSize(600,200); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); Container contentArea=getContentPane(); contentArea.setBackground(Color.yellow); FlowLayout flow=new FlowLayout(); contentArea.setLayout(flow); textArea.setText("text area print"); contentArea.add(textArea); setContentPane(contentArea); } public static void main(String[] args){ Trial2 xyz = new Trial2(); }} Mingw operation : Roger@ROGER-HOME /c/msys/1.0/mingw $ gcj --main=Trial2 Trial2.java Trial2.java:10: error: Type `JTextArea' not found in declaration of field `textArea'. JTextArea textArea=new JTextArea(2,20); ^ 1 error Any ideas why. Thanks. Ares |