• Post Reply Bookmark Topic Watch Topic
  • New Topic

Very simple Swing package question

 
Jes Sie
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm pretty new in the area of Swing for Java.
I've just downloaded a bunch of codes which were written in 1998. The import package for Swing are all "com.sun.java.swing". But my current Java 1.3 IDE uses swing as via "javax.swing".
FIRST QUESTION, what is the main diff between them?

So, initially they have: -
com.sun.java.swing.JPanel
com.sun.java.swing.JLabel
com.sun.java.swing.JFrame
com.sun.java.swing.JTextField
com.sun.java.swing.JButton
com.sun.java.swing.event.ChangeEvent
com.sun.java.swing.event.ChangeListener
I replace all "com.sun.java.swing" with "javax.swing".
The program runs well after that. However, I'm planning to add more features with Java 1.3 Swing classes...so does anyone knows the downside to this?
------------------
Thank you.
- Simon See
simon-ivy@usa.net
-after office hours-
necro-mani-cide
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no downside that is what the package is no and what it used to be. The new versions are all javax.swing.
ps Don't post the same question in multiple forums.
[This message has been edited by Paul Stevens (edited September 20, 2001).]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There really is no difference between the packages. Sun just moved them so that they flowed with all the other packages. You can probably just change your imports and your code should run the same.

------------------
Happy Coding,
Gregg Bolinger
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!