-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddShipment.java
More file actions
75 lines (51 loc) · 2.02 KB
/
AddShipment.java
File metadata and controls
75 lines (51 loc) · 2.02 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//*****************************************************************
// ThreeCellInsert.java Author: Ravyar Sarbast
//
// its for when I need three inputs
//*****************************************************************
package RavyarSarbastTahir;
import javax.swing.*;
import java.awt.*;
import java.util.Calendar;
import java.util.Date;
public class AddShipment extends CenteFrame {
JTextField name;
TextPrompt placeholderName;
JButton adds;
JPanel fields;
JSpinner shippmentdate,arrivaltime;
public AddShipment(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("Shipment", name);
Date date1 = new Date();
SpinnerDateModel dobmodel = new SpinnerDateModel(date1, null, null, Calendar.YEAR);
SpinnerDateModel dobmodel2 = new SpinnerDateModel(date1, null, null, Calendar.YEAR);
dobmodel.setCalendarField(1);
dobmodel2.setCalendarField(1);
shippmentdate = new JSpinner(dobmodel);
arrivaltime = new JSpinner(dobmodel2);
JSpinner.DateEditor ded = new JSpinner.DateEditor(shippmentdate, "dd/MM/yyyy");
JSpinner.DateEditor ded2 = new JSpinner.DateEditor(arrivaltime, "dd/MM/yyyy");
arrivaltime.setEditor(ded2);
shippmentdate.setEditor(ded);
adds = new JButton("Add");
fields.add(name);
fields.add(new JLabel("Shipment Date"));
fields.add(shippmentdate);
fields.add(new JLabel("Arrival Date"));
fields.add(arrivaltime);
main.add(fields);
main.add(adds);
setMinimumSize(new Dimension(600, 100));
//pack();
}
}