-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaintIt.java
53 lines (29 loc) · 968 Bytes
/
paintIt.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package library1;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class paintIt extends JPanel {
private ImageIcon icon;
public void paint(Graphics g) {
icon = new ImageIcon("D:/java new 1/library1/book5.png");
icon.paintIcon(this, g, 25, 11);
// icon.
// System.out.println(icon.getIconHeight());
// System.out.println(icon.getIconWidth());
g.setColor(Color.BLACK);
g.drawRect(24, 10, 851, 50);
setBackground(Color.WHITE);
g.fillRect(130, 30,100, 80);
}
public static void main(String[] args) {
paintIt m=new paintIt();
JFrame f=new JFrame();
f.add(m);
f.setSize(400,400);
//f.setLayout(null);
f.setVisible(true);
}
}