import java.awt.event.*;import javax.swing.*;import java.awt.event.ActionEvent;public class Myclassextends JFrameimplements ActionListener{ int cnt = 0; private JTextArea textArea; public Myclass() { super("Zeichne schön für mich, Bitte!"); Zeichner Z = new Zeichner(); JPanel knopfPanel = new JPanel(); JButton StartButton = new JButton("Start"); star.addActionListener(this); JPanel Panel1 = new JPanel(); Panel1.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.red)); JSplitPane sp =new JSplitPane(JSplitPane.VERTICAL_SPLIT); sp.setLeftComponent(Panel1); sp.setLeftComponent(knopfPanel); sp.setOneTouchExpandable(true); sp.setContinuousLayout(true); sp.setTopComponent(Panel1); sp.setBottomComponent(knopfPanel); Panel1.setMinimumSize(new Dimension(640,405)); Panel1.setPreferredSize(new Dimension(640,410)); knopfPanel.setMinimumSize(new Dimension(640,65)); knopfPanel.setPreferredSize(new Dimension(640,70)); getContentPane().add(sp,"Center"); //Panel1.add(R.startAnimation()); knopfPanel.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.blue)); knopfPanel.add(StartButton); addWindowListener(new WindowClosingAdapter(true)); } public static void main(String[] args) { Zeichner Z = new Zeichner(); Myclass wnd = new Myclass(); wnd.setBackground(Color.lightGray); wnd.setLocation(30,30); wnd.setSize(640,480); wnd.setVisible(true); } public void actionPerformed(ActionEvent actionEvent) { }}class Zeichner extends java.awt.Canvas{ public void startAnimation() { while (true) { repaint(); } } public void paint(Graphics g) { int cnt = 0; ++cnt; g.drawOval(28 + cnt, 31 + cnt, 30, 30); g.setColor(new Color(210, 200, 50)); g.fillOval(28 + cnt, 31 + cnt, 200, 50); try { Thread.sleep(30); } catch (InterruptedException e) { } } }