• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to compile Swing files

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I have learnt my lesson mate. Apologies for my mistake..
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic