Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FirstFrame extends Frame {
- private ImageIcon icon;
- public FirstFrame() {
- icon = new ImageIcon("image.png");
- Button b = new Button("Test");
- b.setBounds(30, 100, 80, 30);
- this.add(b);
- setSize(300, 300);
- setLayout(null);
- setVisible(true);
- }
- @Override
- public void paint(Graphics g) {
- super.paint(g);
- g.drawImage(icon.getImage(), 0, 0, this);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement