-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTreePanel.java
More file actions
50 lines (37 loc) · 990 Bytes
/
TreePanel.java
File metadata and controls
50 lines (37 loc) · 990 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//TreePanel.java
// awt
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.GridLayout;
// swing
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
* Refactored SpotsPanel takes a name as input, then uses it to draw random spots.
* @author Audrey St. John
**/
public class TreePanel extends JPanel
{
/**
* constructor
**/
public TreePanel()
{
// call super constructor
super( new BorderLayout() );
// create the GUI components
initGUI();
}
/**
* Create GUI components.
* returns the created main panel
**/
public void initGUI()
{
//create a JLabel to display the directions
JLabel directions = new JLabel("<html><b><u>TreePainting!!!</u></b><br/>Click and drag to start a tree painting,<br/>Be patient, as painting is a lot of work!<br/></html>");
this.add(directions,BorderLayout.NORTH);
add( new TreePainter(), BorderLayout.CENTER );
}
}