Results 1 to 3 of 3
Thread: subclases
- 11-01-2012, 05:32 AM #1
Member
- Join Date
- Nov 2012
- Posts
- 1
- Rep Power
- 0
subclases
Write the class definition for the subclass of class Window named TiteldWindow. A title window is a window with a title bar. TitledWindow maintains the text appearing on the title bar (string) in a variable named text and the height of the title bar (int) in a variable named barHeight.
The constructor for TitledWindow accepts (in the following order): a width and height, that are passed up to the Window superclass, and a title text and bar height, that are used to initialize its own instance variables.
*****it keeps telling me i have to add something before the instance variable, here is my code.
public class TitledWindow extends Window{
String text;
private int barHeight;
public TitledWindow(int width, int height, String text, int barHeight)
{
super(width, height);
this.text=text;
this.barHeight=barHeight;
}
}
can anyone tell me whats wrong with it?
- 11-01-2012, 07:07 AM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Re: subclases
Looks fine to me. Maybe the import is missing? Which window class is meant?
- 11-01-2012, 12:31 PM #3
Re: subclases
Please go through Guide For New Members and BB Code List - Java Programming Forum and edit your post accordingly.
dbWhy do they call it rush hour when nothing moves? - Robin Williams


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks