Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyFrame extends JFrame {
- public MyFrame() {
- setSize(800, 600);
- setTitle("Picture 1");
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- setVisible(true);
- DrawComponent mc = new DrawComponent();
- add(mc);
- }
- }
- class DrawComponent extends JComponent {
- public void paint(Graphics g) {
- Graphics2D g2 = (Graphics2D) g;
- }
- }
- public class PaintTask1 {
- public static void main(String[] args) {
- MyFrame f = new MyFrame();
- }
- }
Add Comment
Please, Sign In to add comment