LΆΖΠηͺΘAJ^JiΜAvbg
// guie4.java LΆi¬Ά/εΆjΜ{^π·ΖA»Μάά\¦·ι(zρ)ARpCΜxπΘ·
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class guie4 extends Applet implements ActionListener, ItemListener {
final short n = 33;
String X = "", Y = ""; // Xπ\¦pΜΆρΖ·ι
Font f; // ©β·’tHgΙ·ι
Font f2;
int fn;
int flen;
int i;
Choice choicebtn;
Panel pspace; // Ε«ιΎ―\¦{^πO[v»·ι
String w0[] = {"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{",
"|", "}", "~", "", "", "", "", "", "
", "", "", "",
"", "", "", "", "", "", "", "", ""};
String w1[] = {"A[", "x[", "F[", "Q[", "f[", "BG[", "B[", "WF[", "[[", "C[", "C[ NgJ", "J[",
"G", "G", "Gk", "I[", "y[", "G", "GX", "e[", "E[", "Gt", "n[", "cF[",
"`F[", "V[", "VV[", "dΉ", "DC", "ξΉ", "G[", "[", "["};
String W0[] = {"@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
"L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
"X", "Y", "Z", "[", "\", "]", "^", "_", "`"};
String W1[] = {" [", "x[", "₯[", "°[", "Ε[", "‘¦[", "‘ζ[", "Ά₯[", "Ί[", "’[", "’[ ηΖ©β", "©[",
"¦ι", "¦ή", "¦Κ", "¨[", "Ψ[", "¦ι", "¦·", "Δ[", "€[", "¦Σ", "Ν[", "Β₯[",
"Ώ₯[", "΅α[", "΅΅α[", "dΉ", "£’", "ξΉ", "¦[", "δ[", "β["};
Button clear; // \¦ΆπSΑ
Button wb[];
Button Wb[];
Button space, comma, period;
public void init() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
String allFonts[] = ge.getAvailableFontFamilyNames();
flen = allFonts.length;
choicebtn = new Choice();
for(i=0; iactionPerformedΙΟX
*/
public void actionPerformed(ActionEvent event) {
if (event.getSource() == clear ) { System.out.println("~"); X = "";Y = "";repaint(); } else
if (event.getSource() == space ) { System.out.println("qu|"); X = X + " "; repaint(); } else
if (event.getSource() == comma ) { System.out.println("xpp"); X = X + ","; repaint(); } else
if (event.getSource() == period) { System.out.println("uyt"); X = X + "."; repaint(); } else
for( int i = 0; i < n; i++ ) {
if (event.getSource() == wb[i]) { X = X + w0[i]; Y = ""; repaint(); Y = w1[i]; repaint(); }
}
for( int i = 0; i < n; i++ ) {
if (event.getSource() == Wb[i]) { X = X + W0[i]; Y = ""; repaint(); Y = W1[i]; repaint(); }
}
}
public void itemStateChanged(ItemEvent ie) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
String allFonts[] = ge.getAvailableFontFamilyNames();
Choice c = (Choice)ie.getItemSelectable();
fn = c.getSelectedIndex();
f = new Font(allFonts[fn], Font.PLAIN, 50);
f2 = new Font(allFonts[fn], Font.PLAIN, 20);
repaint();
System.out.println(allFonts[fn]);
}
}
ίι