-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogoPanel.java
More file actions
32 lines (27 loc) · 832 Bytes
/
LogoPanel.java
File metadata and controls
32 lines (27 loc) · 832 Bytes
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
/* LearnPanel1
* Created by: Johnson Duong
* Updated on: 2019/05/10
* The first page of the LearnView
*/
import javax.swing.*;
import java.awt.*;
public class LogoPanel extends JPanel
{
ImageIcon image;
//constructor
public LogoPanel()
{
super();
image = new ImageIcon("TypeTutor Logo.png");
this.setPreferredSize(new Dimension(image.getImage().getWidth(null),image.getImage().getHeight(null)));
}//end constructor
//overriding the paintComponent method
public void paintComponent(Graphics g)
{
super.paintComponent(g);
this.setBackground(new Color(56,182,255));
Image pic = image.getImage();
g.drawImage(pic,this.getWidth()/4,0,this.getWidth()/2,this.getHeight(),null);
System.out.println(this.getWidth()+" " + this.getHeight());
}//end paintComponent
}//ssalc