LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Java compilation problem (https://www.linuxquestions.org/questions/programming-9/java-compilation-problem-55140/)

JIV 04-15-2003 10:15 AM

Java compilation problem
 
error in inheriting java.awt.Dialog

import java.awt.*;

public class Textdialog extends Dialog {
TextField tf;
BaseFrame2 theFrame;
Textdialog (Frame parent, String title, boolean modal) {
theFrame = (BaseFrame2)parent;
setLayout(new BorderLayout(10,10));
setBackground(Color.white);
tf = new TextField(theFrame.message,20);
add("Center",tf);
Button b = new Button("OK");
add("South",b);
}
public Insets insets() {
return new Insets(30,10,10,10);
}
}


Textdialog.java:7: cannot resolve symbol
symbol : constructor Dialog ()
location: class java.awt.Dialog
Textdialog (Frame parent, String title, boolean modal) {
1 error ^

zmedico 06-02-2003 10:39 AM

Your Textdialog class needs a constructor that calls one of the existing constructors of the Dialog superclass. For example:

public Textdialog(Frame owner){
super(owner);
}


All times are GMT -5. The time now is 03:07 AM.