Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

strange probelm

 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I used jdk1.2.1 to implement a project, in which I use awt.List. It worked perfect two days ago. But now when I compile, it gave me alot of error about "Interface List", such as
setBounds (....), getSelectedItem () methods are not found in Interface List. List should be a class, how become Interface?
When I compile it in other computers, it is OK. I tried to reinstall JDK1.2.1, the error wont go away.
Anything wrong with the JDK1.2.1. Please help me.
Thanks
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
List is an interface in java.util package. Use fully qualified name will solve your problem.
java.awt.List
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
You are right. But the strange thing is that, the program is compiled OK , just two days ago, with the same version.
Is my jdk changed?
p.s. I did not import java.util.*
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of the people have moved to JDK1.2.2 or JDK1.3 now, I think you should consider it.
All software has bugs, no exceptions to Sun's or yours.
In other words, All software is bug free, until you find one.
Roseanne
[This message has been edited by Roseanne Zhang (edited February 25, 2001).]
 
Sandeep Jain
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I feel , U are importing java.util. package . Now the problem is compilor is not able to decide whether u r refering to a class which is there in java.awt or an interface which is there in java.util.
If this is the problem prefix the package name and ur problem will be solved.

------------------
Sandeep Jain
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic