import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
class Color_Demo extends Frame
{
Scanner sc=new Scanner(System.in);
public Color_Demo()
{
setVisible(true);
setSize(400, 300);
setLayout(new FlowLayout());
setBackground(Color.black);
}
public void paint(Graphics g)
{
g.setColor(Color.magenta);
g.drawString("Enter name",150,100);
String name=sc.nextLine();
Can you tell me whats wrong? I wanted to take input in my container, But I don't know how I can..
I want to use the console typewriter effect with color , and take input from the user. Is there any way?