Share on Google+Share on Google+

hashim fikri
illegal start of type
2 Answer(s)      6 years and 6 months ago
Posted in : Java Beginners

Hello! I'm very new to writing java. And I keep getting the "Illegal Start of Type" error. I've tried everything to fix it. can anyone help me?

import java.awt.Dimens import java.awt.*; import javax.swing.*; import java.util.List; import java.util.LinkedList; import java.util.Iterator; import java.util.ListIterator; import java.util.Collections; import java.awt.event.*;

class reserveform extends JFrame implements {

// operation interface

JPanel operation;
JButton reservbtn, cancel,modify,save;
JButton next,first,last,previous;
JPanel moving;

reserveform (){

    Container c = getContentPane();
    c.setLayout(new FlowLayout());

    //hostcontainer = new JPanel(new FlowLayout());

    name= new JLabel("Name:");
    id = new JLabel("ID");
    address = new JLabel("Address:");
    job = new JLabel("JOB:");

    txtname= new JTextField(20);
    txtid = new JTextField (20);
    txtaddress= new JTextField (20);
    txtjob = new JTextField (20);

    name_id  = new JPanel(new FlowLayout());
    name_id .setBackground(;
    addr_job = new JPanel(new FlowLayout());

    //add elemtents into panel
        name_id.add(name); name_id.add(txtname);
    name_id  .add(id); name_id  .add(txtid);
    addr_job .add(address); addr_job .add(txtaddress);
    addr_job .add(job); addr_job .add(txtjob);

    //hostcontainer.add(name_id  ); hostcontainer.add(addr_job );

    c.add(name_id); c.add(addr_job);

    // building interface for room

    type=new JLabel("Type:  ");
    roomno=new JLabel("roomNo      ");
    arrivingdate=new JLabel("Arriving");
    days= new JLabel("Days:");

    txttype = new JComboBox(new String[]{"Single","Double","Sweet"});

    txtromno= new JTextField(20);
    txtarriving= new JTextField(20);
    txtdays= new JTextField(20);

    roomcontainer = new JPanel(new FlowLayout());

    roomcontainer.add(type); roomcontainer.add(txttype);

    container2= new JPanel(new FlowLayout());
    container2.add(roomno); container2.add(txtromno);

    container3= new JPanel(new FlowLayout());
    container3.add(arrivingdate); container3.add(txtarriving);

    container4 = new JPanel(new FlowLayout());
    container4 .setBackground(;

    c.add(roomcontainer); c.add(container2); c.add(container3); c.add(container4);

    // build interface of operations

    operation= new JPanel(new FlowLayout());

    reservbtn = new JButton("New Resv:"); 

    cancel = new JButton("Cancel");

    modify= new JButton("Modify");

    save = new JButton("Save");

    moving = new JPanel(new FlowLayout());
    moving .setBackground(;
    next = new JButton("Next");

    first= new JButton("first");

    last= new JButton("last");

    previous= new JButton("previous");

    moving.add(first); moving.add(next);    moving.add(previous); moving.add(last);

    operation.add(reservbtn);   operation.add(save);
    operation.add(cancel);      operation.add(modify); 




    if (listA.isEmpty())
        { disableall(); disableaction();}



void enableall() {

void disableall(){


void disableaction()
 cancel.setEnabled(false); modify.setEnabled(false); save.setEnabled(false);
public void clearboxes(){

    txtname.setText(" ");
    txtid.setText(" ");
    txtaddress.setText(" ");
    txtjob.setText(" ");
    txtromno.setText(" ");
    txtarriving.setText(" ");
    txtdays.setText(" ");


public fillinfo() {

      return new reservation(txtname.getText(), txtid.getText(),txtaddress.getText(),
    txtjob.getText(), txtromno.getText(), txtarriving.getText(),txtdays.getText(),  


public void show (reservation ob) {

    if (index< listA.size() && index>=0)
        txtdays.setText(ob.days+" ");



public void actionPerformed(ActionEvent e) {

String lbl=e.getActionCommand();

if(lbl.equals( "New Resv:"))
   { clearboxes();


           index= listA.size()-1;
        if(lbl.equals("Cancel") )
         { listA.remove(index);
            { disableall(); disableaction();clearboxes();}

          else if (lbl.equals("ignore"))
            { clearboxes(); cancel.setText("Cancel"); enableall();}

                index=0;  show((reservation)listA.get(index));cancel.setText("Cancel");
                { index=listA.size()-1; show((reservation)listA.get(index));cancel.setText("Cancel");}
                if(lbl.equals("previous") && index>0)
                index-=1; show((reservation)listA.get(index));cancel.setText("Cancel");

                if(lbl.equals("Next") && (index+1) < listA.size())
                    index+=1;show((reservation)listA.get(index)); cancel.setText("Cancel");




View Answers

October 24, 2010 at 2:11 AM

Let me know the specific line of code that's generating the error message, then perhaps, i can help [email protected]

October 24, 2010 at 12:46 PM

i have error on this part

class reserveform extends JFrame implements {

i hope that you can reply me as soon as posibble...^_^

Related Tutorials/Questions & Answers:
illegal start of type
illegal start of type  Hi, This is my code i m getting illegal start of type as error when i m compiling it,can anyone pls help me to correct this error. public class WriteByteArrayToFile { public static void main(String
illegal start type, HELP!
illegal start type, HELP!  import java.util.Scanner; public class... is " + shipping + " dollars."); } } } Illegal start type error? help?   ... keyboard = new Scanner(; System.out.print("Please type the total number
Illegal Start of Type
Illegal Start of Type  Hello! I'm very new to writing java. And I keep getting the "Illegal Start of Type" error. I've tried everything to fix...,"North"); // building interface for room type=new JLabel("Type: "); roomno=new
illegal start of type
illegal start of type  Hello! I'm very new to writing java. And I keep getting the "Illegal Start of Type" error. I've tried everything to fix... for room type=new JLabel("Type: "); roomno=new JLabel("roomNo
Java error illegal start of type
Java error illegal start of type       The Java error illegal start of type...;} } On Compilation the code show an illegal start of type error. Output
illegal start of expression in servlet error..
illegal start of expression in servlet error..  hello Sir, here is my servlet code and i am getting illegal start of expression error in declaring the method named " public Boolean ModificarUsuario(int IdUsuario
illegal start of expression - Java Beginners
illegal start of expression  here i attach my program.. which shows illgal start of expression.. plz aynone will silve this particular problem.. and correct this particular program.. plz help me
i got illegal start of expression error , plese tell me the mistake where i did...
i got illegal start of expression error , plese tell me the mistake where i did...   import org.springframework.context.*; import java.util.*; public class MyListener implements ApplicationListener { public static void main
Subset Tag (Control Tags) Example Using Start
the start parameter. The start parameter is of integer type. It indicates... a subset of it. The parameter start is of integer type and it indicates...Subset Tag (Control Tags) Example Using Start   
Class Cast & illegal state Exception in blackberry
Class Cast & illegal state Exception in blackberry  tell me please i m facing class cast exception. when i click on Maps & iGoogle in Google Homepage on my emulator then it gives class cast & Illegal State exception
start and deploy
start and deploy  how to deployee java web application in glassfish by using netbeans6.7
obj_start()  hii, What is the use of obj_start()?   hello, Its initializing the object buffer, so that the whole page will be first parsed and stored in output buffer so that after complete page is executed
start pyramid
start pyramid  how to make program use loop to make the output become like this; * ** ** *   import java.lang.*; class Star { public static void main(String args[]) { int k,i,j,p=4; for(i=1;i<5;i
java util date - Time Zone throwing illegal argument exception
java util date - Time Zone throwing illegal argument exception  Sample Code String timestamp1 = "Wed Mar 02 00:00:54 PST 2011"; Date d = new Date... is throwing an Illegal Argument Exception Why is the second SOP always throwing
Start MySQL on Linux
Start MySQL on Linux  hii, How can i start MySQL on Linux? is there any cmd for starting MySQL on linux?   hi, yeah , By typing this cmd you can start MySQL service mysqld start
could not start server. - EJB
could not start server.  Dear All I have installed netbeans 5.5.1 and sun java Application server 9.2 to run ejb program. But when I start... comes ---sun java server could not start. so what should I do to start this server
where to start - Java Beginners
where to start  Myself being a java beginner want to know wat is that I shall start practicing from the day one to make myself get the knowledge... on.   Hi, Thanks for using You can start learning java
JFrame Button click to start play
JFrame Button click to start play  i made a game and and i add a button in new jframe and i want when i click it it start to play...can anyone help me
type casting
type casting  what is type casting
were to start with xml, XSD and java
were to start with xml, XSD and java  where to start with XML, XSD and java ? my task is to develop an application that read from tcp/ip... where to start with this, since I'm a java developer but never working with xml
Type casting
Type casting  how to type cast a string value to byte array
how to start with java - Java Beginners
how to start with java  sir i am new to java and i need the guidence how to start with it . i am doing my MCA final semester project . the project is based on jsp so suggest me the way to follow and cope up with this technology
Week calculate start from friday
Week calculate start from friday  My problem is to calculate how many weeks have a month. Note that my weeks have to start on Friday! I have three combo boxes. First display year. Second one display month. Third one display
Java Web Start and Java Plug-in
extension and mime type associations with Java Web Start application, you can... Java Web Start Enhancements in version 6  ... Java Web Start should check for updates on the web, and what to do when
type casting
List (object type) <Object> totalList(int pi){ try{ Query q...type casting  <--bean class-->method calllist is of object type...){ return null; } how to type cast object type to entity type
type mismatch
type mismatch  Statement s= con.createStatement(); this line gives error of "type mismatch" I am using eclips nd new to servlet nd JDBC, Please help me, Thank you
type casting
type casting  int n=20; n=sizeof((char)(float)n); what is n value
data type
data type  which data type is used to store video file in mysql databse
Java Kick Start - Java Beginners
in core java, collections then you can start with JSP and Servlets. http
Java Web Start
Java Web Start       Sun Microsystems has developed a framework named Java Web Start. This framework allows us to directly start application software for the Java
Struts Quick Start
Struts Quick Start Struts Quick Start to Struts technology In this post I will show you how you can quick start the development of you struts based project... of the application fast. Read more: Struts Quick Start
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code


Advertisement null