Results 1 to 12 of 12
- 12-20-2011, 07:51 PM #1
Senior Member
- Join Date
- Nov 2011
- Location
- Turkey
- Posts
- 378
- Blog Entries
- 24
- Rep Power
- 2
Is javax.swings.JFrame class a subclass of java.awt.Frame ?
Quoting from the book: Java, Java, Java, Object-Oriented Problem Solving (3rd Edition)
"For example, the javax.swing.JFrame class, which represents a top-level window, is a subclass of java.awt.Frame."
Is this true ?
Link to the book is:
Amazon.com: Java, Java, Java, Object-Oriented Problem Solving (3rd Edition) (9780131474345): Ralph Morelli, Ralph Walde: Books
( I have not touched a single character on the text I have quoted. )
- 12-20-2011, 08:00 PM #2
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
First and one of the best places to look:
Java Platform SE 6
- 12-20-2011, 08:01 PM #3
Senior Member
- Join Date
- Nov 2011
- Location
- Turkey
- Posts
- 378
- Blog Entries
- 24
- Rep Power
- 2
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
Well it looks like it is not, I just wanted to make sure since I am a beginner.
- 12-20-2011, 08:07 PM #4
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
Too much trouble to look up the API, huh?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 12-20-2011, 08:08 PM #5
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 12-20-2011, 08:09 PM #6
Senior Member
- Join Date
- Nov 2011
- Location
- Turkey
- Posts
- 378
- Blog Entries
- 24
- Rep Power
- 2
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
I am really not lazy.
I just cant be sure since that looks like a serious book.
So if you are here to judge, save your thoughts please.
All I require is simple Yes or No answer. I am a beginner, and I do not have anyone experienced around me to consult.
Thanks.
- 12-20-2011, 08:11 PM #7
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
Did you bookmark the link to the API doc so you can find it easily for future questions like this one?
- 12-20-2011, 08:11 PM #8
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
Nobody has judged you. Have you looked at the API? It's not a book, so since you're calling it one, the answer must be no. Looking at the API is a very important skill to learn, especially if you do not have other programmers to consult.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 12-20-2011, 08:16 PM #9
Senior Member
- Join Date
- Nov 2011
- Location
- Turkey
- Posts
- 378
- Blog Entries
- 24
- Rep Power
- 2
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
I am not calling the API a book.
The book I am quoting from is a book.
And I was clearly mistaken that because they were different packages, I thought somehow it was wrong information.
I thought a class could only extend a class from the same package.
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
So I was confused in this last step where javax.swing.JFrame extends java.awt.Frame, because it is a different package.
Thanks.
- 12-20-2011, 08:29 PM #10
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
If that was the case, you couldn't get very far. How would anything outside of java.lang extend Object? How would you write your own classes that extend existing ones?
Lesson learned: test all of your assumptions! The best way to do this is to write small programs and consult the API.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 12-20-2011, 08:33 PM #11
Senior Member
- Join Date
- Nov 2011
- Location
- Turkey
- Posts
- 378
- Blog Entries
- 24
- Rep Power
- 2
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
Yes I was confused with awt and swing, I remember reading something like AWT was old and Swing was something completely new and different.
I was clearly mistaken and confused. Sorry if the question was way too silly.
Anyway thanks, although it was a bit harsh, I learned that classes can extend classes from different packages.
Thanks again.
- 12-20-2011, 08:40 PM #12
Re: Is javax.swings.JFrame class a subclass of java.awt.Frame ?
Recommended reading: Swing (Java) - Wikipedia, the free encyclopedia
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Help with creating new class as a subclass in Java
By Monkeeboy in forum New To JavaReplies: 3Last Post: 01-22-2011, 03:06 PM -
weird insets change in JFrame subclass
By sowilo in forum AWT / SwingReplies: 4Last Post: 11-18-2009, 12:27 AM -
Super class refering to subclass
By sujith123 in forum New To JavaReplies: 3Last Post: 10-05-2009, 09:00 AM -
subclass vs inner class
By bugger in forum New To JavaReplies: 1Last Post: 01-13-2008, 07:31 PM -
which class is superclass and subclass?
By java_fun2007 in forum New To JavaReplies: 0Last Post: 12-11-2007, 08:55 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks