import javax.swing.*; import java.awt.event.*; import java.awt.BorderLayout; import java.awt.Dimension; import java.util.ArrayList; import java.lang.String.*; import java.io.*; import java.awt.font.*; import java.awt.*; public class EnterWord extends JPanel { public static char[] palabra; private static int index = 0; private String frase = "Ingrese una palabra y luego presione enter:"; char[] indicacion; public EnterWord() { setSize(800,200); palabra = new char [20]; indicacion = frase.toCharArray(); } /**Metodo que permite dibujar este panel*/ public void paint(Graphics g) { g.setColor(Color.white); g.fillRect(0,0,800,200); g.setColor(Color.black); g.setFont(new Font("times new roman",4, 25)); g.drawChars(indicacion,0,indicacion.length,30,50); g.drawChars(palabra,0,palabra.length,30,95); repaint(); } public char[] getPalabra() { return (char[])(palabra); } }