????????????ü??
???????????? ???????[ 2011/9/21 9:20:10 ] ????????
????ParticipantsInDB??????DBTable????????????????????????????????DBTable?????????????DBTable??clear?? getConn?? getTableName ????????
?????????delegation??
?????????????????????ParticipantsInDB??clear???????????????????????DBTable??clear???????????????????????ParticipantsInDB??????????м??????????DBTable?????????????????????????м??С??????delegation??????
?????????????bug??????????????????
ParticipantsInDB partsInDB = ...;
Participant kent = new Participant(...);
Participant paul = new Participant(...);
partsInDB.clear();
partsInDB.addParticipant(kent);
partsInDB.addParticipant(paul);
partsInDB.deleteParticipant(kent.getId());
//?????????????ParticipantsInDB??????????getCount??????????
System.out.println("There are "+partsInDB.getCount()+ "participants");
?????????£??????????????ParticipantsInDB ?? DBTableIn?????м?й??????????????????????????????С??????????????????????????DBTable????Щ????????????????????public??????????clear????????????????????е??????????????DBTable?????????public???????????????
????????????????????????
????????????????????????????????????Component???????GUI???????簴????????????????????????????????
abstract class Component {
boolean isVisible;
int posXInContainer;
int posYInContainer;
int width;
int height;
...
abstract void paint(Graphics graphics);
void setWidth(int newWidth) {
...
}
void setHeight(int newHeight) {
...
}
}
class Button extends Component {
ActionListener listeners[];
...
void paint(Graphics graphics) {
...
}
}
class Container {
Component components[];
void add(Component component) {
...
}
}
??????????????д??????clock????????????????????????????ε??????θ????????????λ??????????????????????????GUI?????????????????????????Component??
class ClockComponent extends Component {
...
void paint(Graphics graphics) {
//????????????????????
}
}
$news-page$
??????????????????????????????????????ε??????????????????Component??width??height???????????setWidth ?? setHeight??Щ??????????Щ???????????ε???????????????
?????????????????????????????????????????????????????????м?й????ClockComponent?????Component????????????Compoent??????Button???????????
??????ParticipantsInDB??????????????????????ò?????ClockComponent????????Component??????????????????????????????????Container?С???????????????????Component?????????á??????????
????????????Component??????width?? height?? setWidth ?? setHeight??Щ????????y?????????????Component?????????????????????????????????????????????????е?????????????????????????ClockComponent?????????
??????????????????????????????е??????е???????????????????????????????
?????????г??????????Щ?????
????????????????Component???????????????????????????Щ??????Button????????????????????????????Щ????????????????ε????
??????????е??????????????RectangularComponent????????width??height??setWidth??setHeight?????????????Button??????????
abstract class Component {
boolean isVisible;
int posXInContainer;
int posYInContainer;
...
abstract void paint(Graphics graphics);
}
abstract class RectangularComponent extends Component {
int width;
int height;
void setWidth(int newWidth) {
...
}
void setHeight(int newHeight) {
...
}
}
class Button extends RectangularComponent {
ActionListener listeners[];
...
void paint(Graphics graphics) {
... }
}
class ClockComponent extends Component {
...
void paint(Graphics graphics) {
//????????????????????
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11