Problems with javax.swing (Java)

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Problems with javax.swing (Java)

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

javax.swing.border, not javax.swing.Border.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.*;
:?:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Correct, subpackages are not imported automatically.
Post Reply