#9 자바 리포트
- 최초 등록일
- 2013.12.12
- 최종 저작일
- 2012.04
- 8페이지/ MS 워드
- 가격 1,000원
목차
1. 그림판 프로그램
2. 교재에 있는 BounceThread.java를 참조하여 다음 과정을 통해 프로그램을 작성하시오.
본문내용
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Drawing
{
public static void main (String[] args)
{
JFrame frame = new JFrame ("Drawing Board");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
DrawPanel tp = new DrawPanel();
frame.getContentPane().add(tp);
frame.pack();
frame.setVisible(true);
}
}
class DrawPanel extends JPanel{
private Color cl;
public DrawPanel() {
setLayout (new FlowLayout());
JPanel b = new JPanel ();
final JRadioButton red = new JRadioButton();
final JRadioButton blue = new JRadioButton();
final JRadioButton black = new JRadioButton();
final CenterPanel p = new CenterPanel();
addButton(b, "clear", new ActionListener(){
public void actionPerformed(ActionEvent evt){
p.clear();
참고 자료
없음