-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJumblePanel.java
More file actions
55 lines (38 loc) · 1.08 KB
/
JumblePanel.java
File metadata and controls
55 lines (38 loc) · 1.08 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
import java.awt.Color;
import java.awt.Graphics;
import java.util.Arrays;
import javax.swing.JPanel;
public class JumblePanel extends JPanel {
LanguageMap map;
public JumblePanel(LanguageMap map) {
this.map = map;
this.setBackground(new Color(100,200,150));// just to make sure we can change...
}
public void loadDictionary(){
map.scan();
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawRect(0, 0, 400, 100);
g.drawRect(500, 0, 1000, 200);
g.drawRect(0, 225, 400, 100);
g.drawRect(500, 225, 1000, 200);
g.drawRect(0, 450, 400, 100);
g.drawRect(500, 450, 1000, 200);
g.drawRect(0, 675, 400, 100);
g.drawRect(500, 675, 1000, 200);
}
public String solve(String one){
return map.getString(one);
}
public String multisolve(String one){
return map.multiString(one);
}
public String alphabetize(String a){
char[] chars = a.toCharArray();
Arrays.sort(chars);
String alphabetized = new String(chars);
alphabetized.toLowerCase();
return alphabetized;
}
}