Results 1 to 9 of 9
- 03-05-2010, 08:37 PM #1
Member
- Join Date
- Jul 2009
- Posts
- 18
- Rep Power
- 0
- 03-05-2010, 08:52 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Im not so sure about this..
But maybe, Only Maybe.. you could do:
boolean isAncestor = (KeyObject.getClass().getSuperclass() == KeyEvent)
Idk. im not sure, but it would be my guess..
- 03-05-2010, 09:01 PM #3
Senior Member
- Join Date
- Feb 2009
- Posts
- 303
- Rep Power
- 5
Java Code:if (e instanceof KeyEvent) { KeyEvent e2 = (KeyEvent)e; }
- 03-06-2010, 09:25 AM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Hum.. last time I checked instanceOf was broken, have they fixed that?
- 03-06-2010, 10:58 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
- 03-09-2010, 06:50 AM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
Ohwell.
When I tried to use it in one of my first codes for about half a year ago.
Then it didnt work and I asked why and got the answer that it was broken :(
- 03-09-2010, 08:16 AM #7
Sure, if you tried instanceOf your code wouldn't compile. Java is case sensitive.
db
- 03-09-2010, 05:16 PM #8
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
yea I used the real instance of method even if I misspelled it in this post.
- 03-09-2010, 05:40 PM #9
Similar Threads
-
"Could not find the main class: comparisonDemo.class. Program will exit."
By ziisrick in forum New To JavaReplies: 6Last Post: 05-18-2010, 05:11 PM -
Could not find main class
By Andyj in forum New To JavaReplies: 2Last Post: 10-06-2009, 12:47 AM -
Can't find class
By bozovilla in forum New To JavaReplies: 2Last Post: 07-31-2008, 05:45 AM -
Could not find main class - JDK 1.6
By Syranno in forum New To JavaReplies: 1Last Post: 07-25-2008, 04:07 PM -
Able to find class file in WEB-INF/classes but not after add sub folders in class dir
By vitalstrike82 in forum Web FrameworksReplies: 0Last Post: 05-13-2008, 06:16 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks