Re: Trouble calculating point
From: Dirk Starke (dstarkeCUT_IT_at_starke-net.de)
Date: 03/07/05
- Next message: Balaji M via JavaKB.com: "Building Graphical Network."
- Previous message: John: "Re: DefaultTableModel() is a crap / How to hide a Table column?"
- In reply to: Boudewijn Dijkstra: "Re: Trouble calculating point"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Mar 2005 03:34:47 -0800
Hello Boudewijn,
> > void resetPositionComboTD()
> > {
> > Point loc = this.getLocationOnScreen();
> >
> > int newY = loc.y - sw.getHeight();
> > int newX = loc.x;
> >
> > sw.setLocation(newX, newY);
> > }
> [...]
> What is 'this' and what is 'sw'?
'this' is (at any time and any place) a "pointer" to the object whose
code is currently executed. In the above described case it is a
"pointer" to the instance of the class which contains method
resetPositionComboTD(). The code would also work if "this." was
omitted.
'sw' must be a member of the class.
Regards,
Dirk
- Next message: Balaji M via JavaKB.com: "Building Graphical Network."
- Previous message: John: "Re: DefaultTableModel() is a crap / How to hide a Table column?"
- In reply to: Boudewijn Dijkstra: "Re: Trouble calculating point"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|