-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNorthPanel.java
More file actions
34 lines (31 loc) · 938 Bytes
/
NorthPanel.java
File metadata and controls
34 lines (31 loc) · 938 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
import javax.swing.*;
import java.awt.*;
/**
* The Responder class manage north panel
*
* @author omid mahyar and pouyan hesabi *
* @version 1.0 (1398/04/05)
*/
public class NorthPanel extends JPanel {
JLabel name = new JLabel();
JTextField searchArea = new JTextField();
IconForButton searchButton = new IconForButton("icons/search.png");
public NorthPanel() {
this.setBackground(Color.DARK_GRAY);
this.setLayout(new FlowLayout());
searchArea.setPreferredSize(new Dimension(150, 30));
searchButton.setPreferredSize(new Dimension(100, 30));
this.add(searchArea);
this.add(searchButton);
}
/**
* adding client name too panel panel
*
* @param s a String who name of client
*/
public void addNameToNorthPanel(String s) {
name.setText(s);
name.setForeground(Color.GREEN);
this.add(name, FlowLayout.LEFT);
}
}