Page 1 of 1

Problems with javax.swing (Java)

Posted: Sat Dec 01, 2007 4:21 pm
by superdezign
So I have to make a program for school and I refactored the code so that I could follow it (everything was bunched up into 1 class which was very difficult to follow) and now, I can't get it to compile. ;_;

What gets me is that I'm getting an compile-time error on the default Java classes.

Code: Select all

cannot find symbol
symbol  : class Border
location: package javax.swing
import javax.swing.Border;
                  ^

Code: Select all

cannot find symbol
symbol  : class Border
location: class MyClass
		Border border = BorderFactory.createLineBorder(Color.black);
		^
I'm lost. o.o
Would anyone happen to have any insight on this problem?

Posted: Sat Dec 01, 2007 4:28 pm
by feyd
javax.swing.border, not javax.swing.Border.

Posted: Sat Dec 01, 2007 4:34 pm
by superdezign
^_^

So, when I import a package, it doesn't automatically import subpackages? Ohhh... Okay. :)

I need to have both:

Code: Select all

import javax.swing.*;
and

Code: Select all

import javax.swing.border.*;
:?:

Posted: Sat Dec 01, 2007 4:35 pm
by feyd
Correct, subpackages are not imported automatically.