When compiling the code at bottom, javac gave the following error:
TextAreaTest.java:7: cannot resolve symbol
symbol: class HeadlessException
public Dimension getPreferredSize() {
^
1 error
It seems that either HeadlessException is not treated as a RuntimeException,
or it is not getting properly loaded when the superclass is being subclassed.
Either way, the error message is incorrect, since method getPreferredSize()
has nothing to do with HeadlessException.
This is serious bug as some code that compiled with 1.3 and before will no
longer compile in 1.4.
import java.awt.Dimension;
import java.awt.TextArea;
public class TextAreaTest {
public TextAreaTest() {
TextArea userTextArea = new TextArea( "Java!" ) {
public Dimension getPreferredSize() {
return new Dimension( 300, 100 );
}
};
}
public static void main( String argv[] ) {
TextAreaTest demo = new TextAreaTest();
}
}
shinsuke.fukuda@Eng 2000-07-31
TextAreaTest.java:7: cannot resolve symbol
symbol: class HeadlessException
public Dimension getPreferredSize() {
^
1 error
It seems that either HeadlessException is not treated as a RuntimeException,
or it is not getting properly loaded when the superclass is being subclassed.
Either way, the error message is incorrect, since method getPreferredSize()
has nothing to do with HeadlessException.
This is serious bug as some code that compiled with 1.3 and before will no
longer compile in 1.4.
import java.awt.Dimension;
import java.awt.TextArea;
public class TextAreaTest {
public TextAreaTest() {
TextArea userTextArea = new TextArea( "Java!" ) {
public Dimension getPreferredSize() {
return new Dimension( 300, 100 );
}
};
}
public static void main( String argv[] ) {
TextAreaTest demo = new TextAreaTest();
}
}
shinsuke.fukuda@Eng 2000-07-31