avatar
Re: JPanel help!# Java - 爪哇娇娃
o*d
1
1 Create the frame
2 create the Panel
3 create the button
4 create an instance of listener class which implements the
ActionLister interface.
5 register the listener object to the button
6 add button to the panel
7 add the panel to the frame.
8 Make the frame show on the screen
Actually, if you have a Swing book, open the chaper of
"Event", it will have at least one sample code which is
similar to the problem you are trying to deal with.
avatar
s*i
2
override the function "paintComponent()" in JPanel.
and to repaint, just call "repaint()".
it will then call your paintComponent() to refresh view.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。