ƒLƒŠƒ‹•ΆŽš‚Ζ‚Π‚η‚ͺ‚ȁAƒJƒ^ƒJƒi‚ΜƒAƒvƒŒƒbƒg
// guie4.java ƒLƒŠƒ‹•ΆŽši¬•ΆŽš/‘ε•ΆŽšj‚Μƒ{ƒ^ƒ“‚π‰Ÿ‚·‚ƁA‚»‚Μ‚ά‚ά•\Ž¦‚·‚ι(”z—ρ)AƒRƒ“ƒpƒCƒ‹Žž‚ΜŒ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; // Œ©‚β‚·‚’ƒtƒHƒ“ƒg‚Ι‚·‚ι 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[", "ƒBƒG[", "ƒBƒˆ[", "ƒWƒF[", "ƒ[[", "ƒC[", "ƒC[ ƒNƒ‰ƒgƒJƒ„", "ƒJ[", "ƒGƒ‹", "ƒGƒ€", "ƒGƒk", "ƒI[", "ƒy[", "ƒGƒ‹", "ƒGƒX", "ƒe[", "ƒE[", "ƒGƒt", "ƒn[", "ƒcƒF[", "ƒ`ƒF[", "ƒVƒƒ[", "ƒVƒVƒƒ[", "d‰Ή", "ƒDƒC", "“ξ‰Ή", "ƒ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("„„‚„€„q„u„|"); X = X + " "; repaint(); } else if (event.getSource() == comma ) { System.out.println("„x„p„„‘„„„p„‘"); X = X + ","; repaint(); } else if (event.getSource() == period) { System.out.println("„„u„‚„y„€„t"); 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]); } }
–ί‚ι