-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddNewTime.java
More file actions
26 lines (23 loc) · 801 Bytes
/
addNewTime.java
File metadata and controls
26 lines (23 loc) · 801 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
import javax.swing.*;
import java.awt.*;
import java.text.ParseException;
import javax.swing.text.MaskFormatter;
public class addNewTime
{
public void createTimeDialog(String response) throws ParseException
{
JFrame frame = new JFrame();
JPanel panel = new JPanel( new BorderLayout(5,0) );
panel.add(new JLabel("Enter New Time: "), BorderLayout.WEST);
MaskFormatter mask = new MaskFormatter("##':##.'##");
mask.setPlaceholderCharacter('0');
JFormattedTextField text = new JFormattedTextField(mask);
text.setValue("00:00.00");
panel.add(text);
frame.add(panel);
frame.setVisible(true);
response = text.getText();
System.out.println("TRUE1");
return;
}
}