-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddEmployee.java
More file actions
53 lines (40 loc) · 1.48 KB
/
AddEmployee.java
File metadata and controls
53 lines (40 loc) · 1.48 KB
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
//*****************************************************************
// ThreeCellInsert.java Author: Ravyar Sarbast
//
// its for when I need three inputs
//*****************************************************************
package RavyarSarbastTahir;
import javax.swing.*;
import java.awt.*;
import java.text.NumberFormat;
public class AddEmployee extends CenteFrame {
JTextField name, job, salary;
TextPrompt placeholderName, placeholderJob, placeHolderSalary;
JButton adds;
JPanel fields;
public AddEmployee(int x, int y, JFrame frame) throws HeadlessException {
centerScreen(x, y, frame);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setVisible(true);
Container c = getContentPane();
JPanel main = new JPanel();
c.add(main);
fields = new JPanel();
fields.setLayout(new BoxLayout(fields, BoxLayout.X_AXIS));
main.setLayout(new GridLayout(2, 1, 10, 10));
name = new JTextField(10);
placeholderName = new TextPrompt("Name", name);
job = new JTextField(10);
placeholderJob = new TextPrompt("Job", job);
salary = new JFormattedTextField(NumberFormat.getNumberInstance());
placeHolderSalary = new TextPrompt("Salary", salary);
adds = new JButton("Add");
fields.add(name);
fields.add(job);
fields.add(salary);
main.add(fields);
main.add(adds);
setMinimumSize(new Dimension(600, 100));
//pack();
}
}