1 Replies - 142 Views - Last Post: 03 October 2012 - 03:42 AM Rate Topic: -----

#1 XLorenz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-October 12

screen keeps loading

Posted 03 October 2012 - 03:39 AM

import javax.swing.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.io.FileReader;

public class aaaaaa extends Applet implements ActionListener, ItemListener
{
Button Add = new Button("ADD");
Button Delete = new Button("DELETE");
Button Delete1 = new Button("DELETE");
Button Edit = new Button("EDIT");
Button Edit1 = new Button("EDIT");
Button View = new Button("VIEW");
Button Ok = new Button("OK");
Button BMenu = new Button("Menu");
Button BView = new Button ("View");
Button Clear = new Button("Clear");
Button Pro = new Button("Proceed");
Button VFile = new Button("View File");

Label Name = new Label("Name: ");
Label Age = new Label("Age: ");
Label Addr = new Label("Address: ");
Label Seat = new Label("Seat No:");
Label VSeat = new Label("Seat No: ");
Label Class1 = new Label("Class:");
Label Cash = new Label("Cash: ");
Label Change =new Label("Change");
Label ADD = new Label("MENU > ADD>");
Label VIEW = new Label("MENU > VIEW>");
Label DELETE = new Label("MENU > DELETE>");
Label EDIT = new Label("MENU > EDIT>");
Label INFORMATION = new Label("INFORMATION:");
Label LAYOUT = new Label(" ");

TextField TChange = new TextField("",10);
TextField TName = new TextField("",10);
TextField TAge = new TextField("",10);
TextField TAddr = new TextField("",10);
TextField TSeat = new TextField("",10);
TextField TCash = new TextField("",10);
TextField VTSeat = new TextField("",5);
TextField TCSeat = new TextField("",5);
TextArea taDis = new TextArea(2,30);

String SName[][];
int SAge[][];
String SAddr[][];

String StudFile = new String();
String StudFile1 = new String();
Choice lst = new Choice();
GridLayout Grid1 = new GridLayout(0,4);
GridLayout Grid2 = new GridLayout(0,2);
BufferedReader inputStream;

Choice fle = new Choice();

public void init(){
setLayout(new FlowLayout(FlowLayout.LEFT));
setSize(300,30);
add(Add);
add(View);
add(Delete);
add(Edit);
taDis.setEditable(false);
Add.addActionListener(this);
Edit.addActionListener(this);
Edit1.addActionListener(this);
Delete.addActionListener(this);
Delete1.addActionListener(this);
View.addActionListener(this);
Ok.addActionListener(this);
Clear.addActionListener(this);
lst.addItemListener(this);
BMenu.addActionListener(this);
BView.addActionListener(this);
BMenu.addActionListener(this);
Pro.addActionListener(this);
BView.addActionListener(this);
BMenu.addActionListener(this);
lst.add("Class A");
lst.add("Class B");
lst.add("Class C");
}//INIT


public void add(){
setSize(200,200);
remove(View);remove(Add);remove(Delete);remove(Edit);
add(ADD);add(LAYOUT);
add(Seat);
add(TSeat);
add(Name);
add(TName);
add(Age);
add(TAge);
add(Addr);
add(TAddr);
add(Class1);
add(lst);
add(Ok);
add(Clear);
add(BMenu);
}//add

public void view(){
setSize(239,175);
remove(Add);remove(View);remove(Delete);remove(Edit);
add(VIEW);
add(VSeat);
add(VTSeat);
add(INFORMATION);
add(taDis);
add(BView);
add(BMenu);
}//view


public void delete(){
setSize(239,175);
remove(Add);remove(View);remove(Delete);remove(Edit);
add(DELETE);
add(VSeat);
add(VTSeat);
add(INFORMATION);
add(taDis);
add(BView);
add(Delete1);
add(BMenu);
}//delete

public void edit1(){
setSize(239,175);
remove(Add);remove(View);remove(Delete);remove(Edit);
add(EDIT);
add(VSeat);
add(VTSeat);
add(INFORMATION);
add(taDis);
add(BView);
add(Edit1);
add(BMenu);
}//Edit


public void edit2(){
setSize(200,200);
remove(View);remove(Add);remove(Delete);remove(Edit);
remove(Delete1);add(EDIT);add(LAYOUT);remove(taDis);
remove(VSeat);remove(VTSeat);remove(INFORMATION);
remove(Edit1);remove(BView);
add(Seat);
add(TSeat);
add(Name);
add(TName);
add(Age);
add(TAge);
add(Addr);
add(TAddr);
add(Class1);
add(lst);
add(Ok);
add(Clear);
add(BMenu);
}//add

public void menu(){
remove(DELETE);remove(VSeat);remove(VTSeat);remove(taDis);remove(BView);remove(fle);remove(VFile);
remove(EDIT);remove(Seat);remove(TSeat);remove(Name);remove(TName);remove(Age);remove(TAge);remove(Addr);
remove(TAddr);remove(Class1);remove(lst);remove(Ok);remove(BMenu);remove(Clear);remove(Cash);
remove(Edit1);remove(VIEW);remove(INFORMATION);remove(TCash);remove(BMenu);remove(Pro);remove(Change);remove(TChange);remove(LAYOUT);remove(ADD);
VTSeat.setText("");
taDis.setText("");
add(Add);
add(View);
add(Delete);
add(Edit);
}// main menu

public void actionPerformed(ActionEvent x){

if(x.getSource() == Add){
add();
}//ADD

if(x.getSource()== View){
view();
}//VIEW

if(x.getSource()== Delete){
delete();
}//Delete

if(x.getSource()== Edit){
edit1();
}//Edit

if(x.getSource()== Edit1){
edit2();
}//Edit

if(x.getSource()==BMenu){
menu();
init();
}//MENU

if(x.getSource()==Clear){
TSeat.setText("");
TName.setText("");
TAge.setText("");
TAddr.setText("");
}//CLEAR

if(x.getSource()==BView){
}//VIEW

if(x.getSource()==Pro){
}//PROCEED
}

public void itemStateChanged(ItemEvent ie){
if(lst.getSelectedIndex() == 0){
StudFile= "A.txt";
}
else if(lst.getSelectedIndex() == 1){
StudFile= "B.txt";
}
else if(lst.getSelectedIndex() == 2){
StudFile= "C.txt";
}
}//ITEM EVENT
}//CLASS

Is This A Good Question/Topic? 0
  • +

Replies To: screen keeps loading

#2 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 561
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: screen keeps loading

Posted 03 October 2012 - 03:42 AM

Please edit your post and wrap your code in code tags. You can see the tag in the editor labelled [code]

Also, my mind reading skills are a bit off today, mind also posting a proper question in the post, not just a fague thing in the title.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1