Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

In need of assistance

  Asked By: Conrad    Date: Mar 24    Category: Java    Views: 674
  

This portion of the code works just fine.
Now what I would like, is that when the user clicks on create
schedual, the application would clear the page and allow for a new
page [or thread i believe] to come on... Anyone able to enligthen me
on how i can do such a thing ? If so, thanks !


import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class GUInterface extends Applet implements ItemListener
{
Panel firstRow = new Panel();
Panel secondRow = new Panel();
Panel thirdRow = new Panel();
Panel fourthRow = new Panel();
Panel fifthRow = new Panel();
Panel sixRow = new Panel();
Panel seventhRow = new Panel();
Panel eightRow = new Panel();
Panel nineRow = new Panel();
Label companyName = new Label("Enter Your Company
Here",Label.CENTER);
Label studentID = new Label("Enter Your Student ID: ");
TextField studentField = new TextField(10);
Label lblSemester = new Label("Which Semester are you
registering for ?");
Choice semesterBox = new Choice();
Label numClasses = new Label("How many classes would you like
to register ?");
Choice classesNum = new Choice();
Button CreateButton = new Button("Create Schedual");

public void init()
{
setBackground(Color.gray);
setLayout(new BorderLayout());
Panel requestPad = new Panel(new GridLayout(9,1));
FlowLayout rowSetup = new FlowLayout
(FlowLayout.LEFT,5,2);
CreateButton.addActionListener(new
SchedButtonHandler(this));
firstRow.add(companyName);
secondRow.add(studentID);
secondRow.add(studentField);
thirdRow.add(lblSemester);
thirdRow.add(semesterBox);
semesterBox.add("Winter");
semesterBox.add("Fall");
fourthRow.add(numClasses);
fourthRow.add(classesNum);
classesNum.add("1");
classesNum.add("2");
classesNum.add("3");
classesNum.add("4");
classesNum.add("5");
classesNum.add("6");
fifthRow.add(CreateButton);

requestPad.add(firstRow);
requestPad.add(secondRow);
requestPad.add(thirdRow);
requestPad.add(fourthRow);
requestPad.add(fifthRow);
add(requestPad);

}
public void itemStateChanged(ItemEvent choice)
{
}

class SchedButtonHandler implements ActionListener
{
Applet applet;
public SchedButtonHandler(Applet a)
{
applet = a;
}

public void actionPerformed (ActionEvent e)
{
if(studentField.getText() == null)
{
applet.showStatus("You must enter
your student ID");
applet.destroy();
}

}
}
}

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Earl Stone     Answered On: Mar 24

I am unfortunately still stuck at the same place but i did find a
hint to my question ! Someone suggested I use CardLayout which would
allow to overlap this present page  with my next one... Any1 has any
idea how that would be possible ?

 
Didn't find what you were looking for? Find more on In need of assistance Or get search suggestion and latest updates.




Tagged: