please i am a final year student in one of the universities in UK and and i am developing a school portal for a secondary school as my final year project and the portal b/c of time i have narrowed to down the scope of the project to only handle the parent accessing their children records ,the teachers being able to input and edit data in the students record and for them also to check the up and down of the performances of the students but i am having errors on the code i have attached the code with the message could some one please help out with this school management system
smakos 0 Newbie Poster
The attachment preview is chopped off after the first 10 KB. Please download the entire file.
import java.io.*;
import java.applet.*;
import java.awt.*;A
import java.awt.event.*;
import java.sql.*;
public class menu extends Frame implements
WindowListener,ActionListener
{
MenuBar mb;
MenuItem student,rollnowise,namewise,allresult;
public static menu m;
rollnowise rw;
namewise n;
student st;
int x,y,d;
public menu()
{
super("menu smakos");
addWindowListener(this);
x=y=700;
d=10;
setSize(x,y);
setBackground(Color.orange);
addMenu();
show();
}
public static void main(String args[])
{
m=new menu();
}
void addMenu()
{
MenuBar mb=new MenuBar();
Menu register=new Menu("REGISTER");
Menu inquery=new Menu("INQUERY");
register.add("STUDENT");
register.add("EXIT");
inquery.add("ROLLNOWISE");
inquery.add("NAMEWISE");
mb.add(register);
mb.add(inquery);
setMenuBar(mb);
register.addActionListener(this);
inquery.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String arg=ae.getActionCommand();
if(ae.getSource() instanceof Menu)
if(arg.equals("EXIT"))
{
System.exit(0);
}
if(ae.getSource() instanceof Menu)
if("STUDENT".equals(arg))
{
st=new student();
st.show();
}
if(ae.getSource() instanceof Menu)
if("ROLLNOWISE".equals(arg))
{
rw=new rollnowise();
rw.show();
}
if(ae.getSource() instanceof Menu)
if("NAMEWISE".equals(arg))
{
n=new namewise();
n.show();
}
}
public void windowClosed(WindowEvent we){}
public void windowDeiconified(WindowEvent we){}
public void windowIconified(WindowEvent we){}
public void windowActivated(WindowEvent we){}
public void windowDeactivated(WindowEvent we){}
public void windowOpened(WindowEvent we){}
public void windowClosing(WindowEvent we)
{
while(x>0 && y>0)
{
setSize(x,y);
x=x-d;
y=y-d;
show();
}
System.out.println("mail me at smartsmakos@yahoo.com");
dispose();
System.exit(0);
}
}
//class for name wise report
class namewise extends Frame implements WindowListener,ActionListener
{
public static namewise nw;
Label l1=new Label("NAME",Label.LEFT);
Label l2=new Label("ROLLNO",Label.LEFT);
Label l3=new Label("COLG",Label.LEFT);
Label l4=new Label("SUB1",Label.LEFT);
Label l5=new Label("SUB2",Label.LEFT);
Label l6=new Label("SUB3",Label.LEFT);
Label l7=new Label("SUB4",Label.LEFT);
Label l8=new Label("SUB5",Label.LEFT);
TextField tf_entername=new TextField(20);
Button but_entername =new Button("FIND");
Button ok=new Button("OK");
Graphics g;
String sqlstr;
Statement st;
GridLayout gl=new GridLayout(1,2);
GridLayout cl=new GridLayout(1,5);
Font font18=new Font("VinetaBT",Font.BOLD|Font.ITALIC,18);
int x,y,d;
Dialog dlg;
Label msg;
public namewise()
{
super("NAMEWISE");
addWindowListener(this);
setLayout(new GridLayout(12,1));
setBackground(Color.orange);
setForeground(Color.black);
addMenu();
x=550;
y=450;
d=100;
setSize(x,y);
show();
}
void addMenu()
{
Panel p4=new Panel();
Label l11=new Label("ENTERNAME");
p4.add(l11);
p4.add(tf_entername);
p4.add(but_entername);
add(p4);
but_entername.addActionListener(this);
ok.addActionListener(this);
//Dialog for confirmation
dlg=new Dialog(this,"Inventory Management System",false);
dlg.setLayout(new GridLayout(2,1));
dlg.setSize(100,100);
dlg.setLocation(200,100);
ok.setSize(50,50);
msg=new Label("NAME NOT FOUND");
dlg.add(msg);
dlg.add(ok);
}
public void actionPerformed(ActionEvent e)
{
Panel p1=new Panel();
l1.setFont(font18);
l2.setFont(font18);
p1.setLayout(gl);
p1.add(l1);
p1.add(l2);
g=getGraphics();
g.drawLine(40,0,40,0);
Panel p2=new Panel();
l3.setFont(font18);
p2.add(l3);
p2.setLayout(gl);
Panel p3=new Panel();
l4.setFont(font18);
l5.setFont(font18);
l6.setFont(font18);
l7.setFont(font18);
l8.setFont(font18);
p3.add(l4);
p3.add(l5);
p3.add(l6);
p3.add(l7);
p3.add(l8);
p3.setLayout(cl);
String arg=e.getActionCommand();
if(e.getSource() instanceof Button)
if("FIND".equals(arg))
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:stu","","");
sqlstr="select * from stu1 where NAME='"+
tf_entername.getText()+"'";
st=con.createStatement();
ResultSet rs;
rs= st.executeQuery(sqlstr);
while(rs.next())
{
Panel a1=new Panel();
l1=new Label("",Label.LEFT);
l2=new Label("",Label.LEFT);
l1.setFont(font18);
l2.setFont(font18);
a1.setLayout(gl);
Panel a2=new Panel();
l3=new Label("",Label.LEFT);
l3.setFont(font18);
a2.setLayout(gl);
Panel a3=new Panel();
l4=new Label("",Label.LEFT);
l5=new Label("",Label.LEFT);
l6=new Label("",Label.LEFT);
l7=new Label("",Label.LEFT);
l8=new Label("",Label.LEFT);
l4.setFont(font18);
l5.setFont(font18);
l6.setFont(font18);
l7.setFont(font18);
l8.setFont(font18);
a3.setLayout(cl);
l1.setText(rs.getString("NAME"));
l2.setText(""+rs.getInt("ROLLNO"));
l3.setText(rs.getString("COLG"));
l4.setText(""+rs.getInt("SUB1"));
l5.setText(""+rs.getInt("SUB2"));
l6.setText(""+rs.getInt("SUB3"));
l7.setText(""+rs.getInt("SUB4"));
l8.setText(""+rs.getInt("SUB5"));
a1.add(l1);
a1.add(l2);
a2.add(l3);
a3.add(l4);
a3.add(l5);
a3.add(l6);
a3.add(l7);
a3.add(l8);
add(p1);
add(a1);
add(p2);
add(a2);
add(p3);
add(a3);
show();
}
}
catch(ClassNotFoundException se)
{
tf_entername.setText("Error : " + se.toString());
}
catch(SQLException se)
{
tf_entername.setText("Error : " + se.toString());
}
}
public void windowClosed(WindowEvent we){}
public void windowDeiconified(WindowEvent we){}
public void windowIconified(WindowEvent we){}
public void windowActivated(WindowEvent we){}
public void windowDeactivated(WindowEvent we){}
public void windowOpened(WindowEvent we){}
public void windowClosing(WindowEvent we)
{
while(x>0 && y>0)
{
setSize(x,y);
x=x-d;
y=y-d;
show();
}
dispose();
}
}
//class for rollnowise report
class rollnowise extends Frame implements
WindowListener,ActionListener
{
public static rollnowise rw;
Label l1=new Label("NAME",Label.LEFT);
Label l2=new Label("ROLLNO",Label.LEFT);
Label l3=new Label("COLG",Label.LEFT);
Label l4=new Label("SUB1",Label.LEFT);
Label l5=new Label("SUB2",Label.LEFT);
Label l6=new Label("SUB3",Label.LEFT);
Label l7=new Label("SUB4",Label.LEFT);
Label l8=new Label("SUB5",Label.LEFT);
TextField tf_entername=new TextField(20);
Button but_entername =new Button("FIND");
String sqlstr;
Statement st;
GridLayout gl=new GridLayout(1,2);
GridLayout cl=new GridLayout(1,5);
Font font18=new Font("VinetaBT",Font.BOLD|Font.ITALIC,18);
int x,y,d;
public rollnowise()
{
super("ROLLNOWISE");
addWindowListener(this);
setLayout(new GridLayout(12,1));
setBackground(Color.orange);
setForeground(Color.black);
addMenu();
x=550;
y=450;
d=100;
setSize(x,y);
show();
}
void addMenu()
{
Panel p4=new Panel();
Label l11=new Label("ENTERROLLNO");
p4.add(l11);
p4.add(tf_entername);
p4.add(but_entername);
add(p4);
but_entername.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
Panel p1=new Panel();
l1.setFont(font18);
l2.setFont(font18);
p1.setLayout(gl);
p1.add(l1);
p1.add(l2);
l3.setFont(font18);
Panel p2=new Panel();
p2.add(l3);
p2.setLayout(gl);
Panel p3=new Panel();
l4.setFont(font18);
l5.setFont(font18);
l6.setFont(font18);
l7.setFont(font18);
l8.setFont(font18);
p3.add(l4);
p3.add(l5);
p3.add(l6);
p3.add(l7);
p3.add(l8);
p3.setLayout(cl);
/* Panel p4=new Panel();
Label l11=new Label("ENTERROLLNO");
p4.add(l11);
p4.add(tf_entername);
p4.add(but_entername);
add(p4);
add(p1);
add(p2);
add(p3);
*/
String arg=e.getActionCommand();
if(e.getSource() instanceof Button)
if("FIND".equals(arg))
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:stu","","");
sqlstr="select * from stu1 where ROLLNO="+
tf_entername.getText()+"";
st=con.createStatement();
ResultSet rs;
rs= st.executeQuery(sqlstr);
while(rs.next())
{
Panel a1=new Panel();
l1=new Label("",Label.LEFT);
l2=new Label("",Label.LEFT);
l1.setFont(font18);
l2.setFont(font18);
a1.setLayout(gl);
Panel a2=new Panel();
l3=new Label("",Label.LEFT);
l3.setFont(font18);
a2.setLayout(gl);
Panel a3=new Panel();
l4=new Label("",Label.LEFT);
l5=new Label("",Label.LEFT);
l6=new Label("",Label.LEFT);
l7=new Label("",Label.LEFT);
l8=new Label("",Label.LEFT);
l4.setFont(font18);
l5.setFont(font18);
l6.setFont(font18);
l7.setFont(font18);
l8.setFont(font18);
a3.setLayout(cl);
l1.setText(rs.getString("NAME"));
l2.setText(""+rs.getInt("ROLLNO"));
l3.setText(rs.getString("COLG"));
l4.setText(""+rs.getInt("SUB1"));
l5.setText(""+rs.getInt("SUB2"));
l6.setText(""+rs.getInt("SUB3"));
l7.setText(""+rs.getInt("SUB4"));
l8.setText(""+rs.getInt("SUB5"));
a1.add(l1);
a1.add(l2);
a2.add(l3);
a3.add(l4);
a3.add(l5
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
I voted "very urgent please".
Perhaps if you post the code here in [code]
[/code] tags people will be a little more inclined to look at it.
destin 6 Junior Poster in Training
What is with the poll?
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
*shrug* Who knows? I just voted that apparently he thinks this is urgent (my own feelings of urgency may differ).
dickersonka 104 Veteran Poster
lol you have to give him an A for creativity
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
17 views so far and I'm the only one who voted. :-/
Alex Edwards commented: Fine I'll vote too! XP +4
BestJewSinceJC 700 Posting Maven
I'll help you out, Ezzaral. I voted for the option at the top. I'm still not sure what ugent means, though. *also shrugs*
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
I still don't get the poll.
What does it mean if I vote the first and what does it mean if I vote the second?
iamthwee
I voted help me out because I thought the poll was about my mental health.
stultuske 1,116 Posting Maven Featured Poster
I'm still not sure what ugent means, though. *also shrugs*
urgent means: I've been eating a lot of beans and just figured out I ran out of toilet paper.
as for the starter of this thread, I've read the description of what you want to accomplish, if you are in your last year, this should be somewhat piece of cake ( but since you prefer beans...)
you added some code in attachment.
1. no, I will not download and read it, post it here in code tags
2. if that is all your code, you are bound to fail the hell. don't understand how it's possible how you got passed the first year :/
I take it somewhere sometime during your course it was mentioned that Java is Object Oriented, not?
>> Edit:
you forgot one option in your poll.. it's one of my favourite quotes from Jeff Dunham's Walter-doll..
I don't give a damn, dumbass
if this is urgent to you, it just shows you waited far too long to start working on it.
bobocqu 0 Newbie Poster
wow~
one big class.
I hope you get your answer as soon as possible.
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.