Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9325049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:44:58+00:00 2026-06-19T04:44:58+00:00

I am getting an error illegal start of expression in the code below, at

  • 0

I am getting an error illegal start of expression in the code below, at line -> public class hindilang , I have seen other questions and answers on this site, but i don’t know where i am going wrong ??

    abstract class lang extends JFrame implements KeyListener
    {
    boolean flag=false;
    String firstRow[] = {">","=","*","_","<","{","(","'","?","-","!","[",")"};
    String secondRow[] = {"|","#",".",":","&","@","]","/","}",",","$","^","~"};
    String thirdRow[] = {"d","v","m","y","e","k","a","j","z","3","0","9"};
    String fourthRow[] = {"r","b","p","o","h","w","g","x","1","7","5","4"};
    String fifthRow[] = {"f","c","n","s","l","t","q","u","i","6","2","8"};
    String sixthRow[] = {"Space","Back","Capslock","Clear","Show me mappings"};
    JButton first[] = new JButton[13];
    JButton second[] = new JButton[13];
    JButton third[] = new JButton[12];
    JButton fourth[] = new JButton[12];
    JButton fifth[]=new JButton[12];
    JButton sixth[]=new JButton[5];
    int count=0;
    Panel main = new Panel();
    Panel keys1 = new Panel();
    Panel keys2 = new Panel();
    Panel keys3 = new Panel();
    Panel keys4 = new Panel();
    Panel keys5 = new Panel();
    Panel keys6 = new Panel();
    Panel text = new Panel();
    TextArea textArea = new TextArea();
    String strText = "";
    private JLabel label1;
    private JLabel label2;
    private JTextField textField;

    public lang()
    {
    super("Typing Application");
    label1 = new JLabel("Type some text using your keyboard. The keys you press will be
    "+ "highlighed and the text will be displayed");
    add(label1);
    label2 = new JLabel("Note: clicking the buttons with your mouse will not perform
    any action");
    add(label2);
    textField = new JTextField(30);
    textField.setEditable(false);
    TextFieldHandler handler = new TextFieldHandler();
    this.setLayout(new BorderLayout(6,6));
    main.setLayout(new GridLayout(6,1));
    keys1.setLayout(new GridLayout(1,13));
    keys2.setLayout(new GridLayout(1,13));
    keys3.setLayout(new GridLayout(1,14));
    keys4.setLayout(new GridLayout(1,12));
    keys5.setLayout(new GridLayout(1,11));
    keys6.setLayout(new GridLayout(1,4));
    text.setLayout(new BorderLayout(1,1));
    text.add(textArea);

    for(int i=0; i<13; i++)
    {
    first[i] = new JButton(firstRow[i]);
    first[i].setSize(100,100);
    keys1.add(first[i]);
    first[i].addActionListener(new TextAreaHandler());
    }



    main.add(keys1);
    for(int i=0; i<13; i++)
    {
    second[i] = new JButton(secondRow[i]);
    second[i].setBackground(Color.white);
    keys2.add(second[i]);
    second[i].addActionListener(new TextAreaHandler());
    }

    main.add(keys2);

    for(int i=0; i<12; i++)
    {
    String t=i+"";
    String m="icon";
    String n=".gif";
    String s=m+t+n;
    ImageIcon img = new ImageIcon(s);
    third[i] = new JButton(img);
    keys3.add(third[i]);
    third[i].addActionListener(new TextAreaHandler());
    }

    main.add(keys3);
    int j=12;

    for(int i=0; i<12; i++)
    {
    String t=j+"";
    String m="icon";
    String n=".gif";
    String s=m+t+n;
    ImageIcon img = new ImageIcon(s);
    fourth[i] = new JButton(img);
    keys4.add(fourth[i]);
    j++;
    fourth[i].addActionListener(new TextAreaHandler());
    }

    public class hindilang
    {
       public static void hindi()
          {
             lang lang = new lang()
               {
                 public void keyTyped(KeyEvent e) 
                   {
                        throw new UnsupportedOperationException("Not supported yet.");
                   }
                 public void keyPressed(KeyEvent e) 
                   {
                        throw new UnsupportedOperationException("Not supported yet.");
                   }
                 public void keyReleased(KeyEvent e)
                   {
                        throw new UnsupportedOperationException("Not supported yet.");
                   }
               };
           }
    } 
            lang.setSize(800, 500); // set dimensions of window
            lang.setVisible(true);
    }
    }

The File is saved as hindilang.java and being compiled as javac hindilang.java, What am i doing wrong?? Please guide me

Tried the suggestions below but , still getting the same errors…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T04:45:00+00:00Added an answer on June 19, 2026 at 4:45 am

    You public lang() constructor method is missing a '}' at the end of its method definition just before the problematic line

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting an illegal start of type error at the first nested if
I am trying below code but getting error String x = aaa XXX bbb;
Code first questions later... public class Program2 { //The custom word object used when
I'm getting an error in Netbeans in my driver class on this line: System.out.print(Time
These are my questions: I'm getting a couple of errors on the line public
Why am I getting the error :java:16: error: illegal start of type for(int i
I'm getting the error Illegal access to loading collection when I'm trying to get
I am writing a task's trigger and getting an error in salesforce Illegal polymorphic
I'm getting illegal use of floating point error on compiling the following program. Please
I'm getting an Illegal characters in path error while using XMLTextReader method. Basically, I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.