• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not able to compile Swing files

 
Ishu Sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

All my java files are in the jdk\bin directory but still I am not able to compile the Swing classes. The problem is only for swing classes.
I guess this is a classpath problem. Could anyone please let me know which jar file I need to include in classpath for swings?

Look forward to responses

Regards
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing classes are part of the Java 2 Standard Edition, so it is probably not a classpath issue. There are versions of Java that don't have swing. What is the output of:
 
Mike Rainville
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's difficult to help with no source code or error messages,
but here's an idea ...

Many Java books save space by omitting the import statements that are needed to locate the classes (in Java packages) used in a program.

Does adding these lines at the start of your program, but AFTER the package statement, help?



[ October 31, 2005: Message edited by: Mike Rainville ]

[ October 31, 2005: Message edited by: Mike Rainville ]
[ October 31, 2005: Message edited by: Mike Rainville ]
 
Ishu Sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies friends, It is solved now.
I was using the import statement as
import com.java.swing.*

but Sun has changed this package to javax.swing.* long time ago but I dint know that. Havnt used swings for past four years or so..

Many thanks for your replies.. thanks again
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the lesson here? Post a minimal example program demonstrating your problem.
If you had, "com.sun.swing" is so obvious to Swing programmers that
you would have had your answer in seconds. As it was, your question was
so vague it left forum members scratching their heads and taking wild
guesses. Again, have you learned your lesson?
 
Ishu Sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have learnt my lesson mate. Apologies for my mistake..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!