-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.java
More file actions
56 lines (47 loc) · 1.4 KB
/
Button.java
File metadata and controls
56 lines (47 loc) · 1.4 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
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.border.BevelBorder;
/**
* @author bisho silwal
*/
public class Button {
public static JButton choose_keyboard;
public static RomanizedPanel roman_panel;
public static NepaliKeyboard keyboard;
static boolean ROMANIZED = false;
Button() {
choose_keyboard = new JButton("Romanized keyboard");
;
roman_panel = new RomanizedPanel();
keyboard = new NepaliKeyboard();
choose_keyboard.setBounds(30, 330, 200, 30);
choose_keyboard
.setBorder(new BevelBorder(BevelBorder.RAISED, Color.white, Color.black, Color.white, Color.black));
choose_keyboard.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (ROMANIZED) {
ROMANIZED = false;
choose_keyboard.setText("Romanized keyboard");
roman_panel.setVisible(false);
keyboard.setVisible(true);
MainFrame.getMainFrame().setFocusTraversalKeysEnabled(true);
} else {
ROMANIZED = true;
choose_keyboard.setText("Nepali Keyboard");
MainFrame.getMainFrame().setFocusTraversalKeysEnabled(true);
keyboard.setVisible(false);
roman_panel.setVisible(true);
}
}
});
}
public static boolean isROMANIZED() {
return ROMANIZED;
}
public static void setROMANIZED(boolean rOMANIZED) {
ROMANIZED = rOMANIZED;
}
}