/* * @topic T11348 Spring 2016 Inheritance Demo * @brief class TextBox extends Gadget */ package inheritance_demo; public class TextBox extends Gadget { //-------------------------------------- // data attributes //-------------------------------------- private String value; //-------------------------------------- // constructors //-------------------------------------- public TextBox(int width, int height) { super( 0, 0, width, height ); }//TextBox public TextBox(int topx, int topy, int width, int height) { super( topx, topy, width, height ); }//TextBox //-------------------------------------- // operations //-------------------------------------- public String getValue() { return value; }//getValue public void setValue(String value) { this.value = value; }//setValue @Override public void show() { if ( visible ) { System.out.print( "TextBox:"+value+" " ); } System.out.println(); }//show @Override public void hide() { visible = false; show(); }//hide @Override public void disable() { enabled = false; }//disable @Override public void enable() { enabled = true; }//enable }//class TextBox