I having a serious problem here. This is the code i wrote and i have yet run it because too many errors. I tried minimize the errors. Anyone can help me? As for now even the simple looping also shows error. If you found any other mistake, feel free to correct this java newbie.
PS:i trying to create a gui to let user key in event name and time, then they can check it back. Below is just the gui part, the array part ...i think not neccessary here =)
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class eventgui {
JTextField jtfname = new JTextField();
JLabel jlname = new JLabel("Event:");
JLabel jlstart = new JLabel("Time:");
JLabel jlduration = new JLabel("Duration:");
JButton jbok = new JButton("OK");
JButton jbclear = new JButton("Reset");
String[] time = new String[]{"0800","0900","1000","1100","1200","1300","1400","1500","1600","1700","1800","1900","2000","2100","2200"};
JComboBox jcbtime = new JComboBox(time);
int x=0;
int[] duration = new int[x];
String[] y;
public eventgui(){
for(int a = 1;a<x;a++){
y[a] = (String)duration[a];
}
JComboBox jcbduration = new JComboBox(y);
jcbtime.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
x= (Integer)jcbtime.getSelectedItem();
x-=2300;
x/=100;
}
});
for (int i =1;i<x;i++){
duration[i]=0+x;
}
jbok.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
Event x = new Event(jtfname.getText(),(Integer)jcbtime.getSelectedItem(),(Integer)jcbduration.getSelectedItem());
}});
}
}