#acl All: == ウインドウの内容 == . {{attachment:swing04.png}} {{{#!java import javax.swing.*; import java.awt.*; public class Sample3 { public static void main(String[] args) { JFrame f; Container cp; JPanel p; f = new JFrame(); f.setVisible(true); f.setTitle("swing"); f.setSize(200, 300); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); cp = f.getContentPane(); p = new JPanel(); cp.add(p); } } }}} . {{attachment:swing05.png}} . {{attachment:swing06.png}} {{{#!java import javax.swing.*; import java.awt.*; public class Sample4 extends JPanel { public void paintComponent(Graphics g) { g.drawRect(50,50,100,150); } } }}} {{{#!java public static void main(String[] args) { ... Sample4 p; ... p = new Sample4(); ... } }}}