home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-06-18 | 1.4 KB | 73 lines | [TEXT/dosa] |
- // DesktopComponent.java : this is a Java source code file for the program Facade.
- // Copyright 1998, Andrew S. Downs
- // andrew.downs@tulane.edu
- //
- // This source code is distributed as freeware.
- // Just keep this author information in the file. Enjoy!
-
- import java.awt.*;
- import java.io.*;
-
- public class DesktopComponent extends Component implements Serializable {
- String label;
-
- DesktopComponent() {
- super();
- }
-
- DesktopComponent( String s ) {
- super();
- this.setLabel( s );
- }
-
- public void setLabel( String s ) {
- this.label = s;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- public void setX( int i ) {
- this.setLocation( i, this.getLocation().y );
- }
-
- public int getX() {
- return this.getLocation().x;
- }
-
- public void setY( int i ) {
- this.setLocation( this.getLocation().x, i );
- }
-
- public int getY() {
- return this.getLocation().y;
- }
-
- public void setWidth( int i ) {
- this.setSize( i, this.getSize().height );
- }
-
- public int getWidth() {
- return this.getSize().width;
- }
-
- public void setHeight( int i ) {
- this.setSize( this.getSize().width, i );
- }
-
- public int getHeight() {
- return this.getSize().height;
- }
-
- private void writeObject( ObjectOutputStream s ) throws IOException {
- s.defaultWriteObject();
- }
-
- private void readObject( ObjectInputStream s ) throws ClassNotFoundException, IOException {
- s.defaultReadObject();
- }
- }
-
-
-