need help in java

creating meeting schedule

Page 1 of 1

2 Replies - 875 Views - Last Post: 24 December 2007 - 09:05 AM Rate Topic: -----

#1 harakat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 24-December 07

need help in java

Posted 24 December 2007 - 06:29 AM

please please i really need some help from any one who can offer such a help and i will be thankfullll
the question is very long therefor i attach the finall GUI which i have to creat so please if anyone can open the attach and see the GUI and how it is work help me in writting the cods for this project
thank you and have a look on the attach file please


i am waitting nobody here ???

This post has been edited by Programmist: 24 December 2007 - 03:38 PM

Is This A Good Question/Topic? 0
  • +

Replies To: need help in java

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 250
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: need help in java

Posted 24 December 2007 - 07:46 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#3 harakat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 24-December 07

Re: need help in java

Posted 24 December 2007 - 09:05 AM

thanks and this is the code i need help in there is no error but it dose not work ???
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.List;


public class hello extends JFrame implements ActionListener{
	
	String[] showMeetings={"","",""};
	JButton jbAdd = new JButton("Add");
	JButton jbModify = new JButton("Modify");
	JButton jbDelete = new JButton("Delete");
	JButton jbRefresh = new JButton("Refresh");
	DefaultListModel model;
		JList list;
	Modify md = new Modify(list);
	
	public hello()
	{
		super("hi help help");
								model = new DefaultListModel();
		list = new JList(model);
		for(int index=0;index<	 showMeetings.length;index++)
			
		{
			model.add(index,showMeetings[index]);			
		}		
		this.setSize(600,600);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setLocationRelativeTo(null);
		
		//........................
		Container cP = getContentPane();
		cP.setLayout(new FlowLayout());
		cP.add(list);
		//cP.add(prompt);
		
		FileManager f  = new FileManager();
		f.loadMeetingFromDisk();
		for(int i =0; i < f.lmeets.size(); i++){
			Meeting mc = ((Meeting)f.lmeets.get(i));
			showMeetings[i] = mc.toString();
		}
		
	  list.setListData(showMeetings);
	  list.setVisibleRowCount( 5 );
	  list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION );
	  cP.add( new JScrollPane( list ) );
		
		cP.add(jbAdd);
		cP.add(jbModify);
		cP.add(jbDelete);
		cP.add(jbRefresh);
			
		jbAdd.addActionListener(this);
		jbModify.addActionListener(this);
		jbDelete.addActionListener( this );
		jbRefresh.addActionListener( this );
		
		list.setListData(showMeetings);
		int i = list.getSelectedIndex();
		
		this.setVisible(true);
	}
	Meeting m = new Meeting();
	
	public void actionPerformed(ActionEvent e) {
		JButton bb = (JButton)e.getSource();
		String val = bb.getText();
		
		if(val.equalsIgnoreCase("add")){
			AddMeeting am = new AddMeeting();
			am.setVisible(true);
			
		}
		
		else if(val.equalsIgnoreCase("modify")){
			int i= list.getSelectedIndex();
			
			//Modify m = new Modify();
			//m.setVisible(true);
		}
		else if(val.equalsIgnoreCase("delete")){
			model.remove(list.getSelectedIndex());
		 
		 //list.remove(i);
			//FileManager.saveMeetingsToDisk().remove( FileManager.index );
			 

		}
		
		else if(val.equalsIgnoreCase("refresh")){
			
			FileManager fm = new FileManager();			
			fm.loadMeetingFromDisk();
			
			for (int i =0; i< fm.lmeets.size(); i++){
				
				Meeting mc = (Meeting)fm.lmeets.get(i);
				
				showMeetings[i] = mc.toString();
			}
			list.setListData(showMeetings);
		}
			
	}
}



hope some of the expert help me now the problem is whith the refrshing button and delet and modify
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1