problem running java program

Hello,


I developed a java program with eclipse that has a graphical interface. During the execution of program when I click a button I have the following message that appears:

FATAL: could not find file 'simulator.properties' in default search paths:
'null', 'C:\Users\.../properties'

this is the code :
import net.sourceforge.jpcap.simulator.PacketCaptureSimulator;
import net.sourceforge.jpcap.capture.*;
import net.sourceforge.jpcap.net.*;

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

import java.io.*;

import java.util.*;

import javax.swing.table.*;
import javax.swing.*;

import java.util.*;
public class FB extends JFrame implements ActionListener {
private JButton b;
private TablePanel tablePanel;

public void actionPerformed(java.awt.event.ActionEvent e) {
new Packets().simulate();
}

private void setGui() {
try {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Container cp = getContentPane();
JPanel bPanel = new JPanel();
tablePanel = new TablePanel();
b = new JButton("Afficher");
b.addActionListener(this);
bPanel.add(b);
cp.add(tablePanel, BorderLayout.CENTER);
cp.add(bPanel, BorderLayout.SOUTH);
} catch (Exception e) {
e.printStackTrace();
}
}

private class Packets {

public void simulate() {
try {
PacketCaptureSimulator sim = new PacketCaptureSimulator();
sim.addPacketListener(tablePanel);
sim.capture(256);
sim.close();
}
catch(Exception e) {
e.printStackTrace();
}
}
}


public static void main(String[] args) {
	try {
	SwingUtilities.invokeAndWait(new Runnable() {
	public void run() {
	FB f = new FB();
	f.setGui();
	f.pack();
	f.setVisible(true);

	}
	});
	} catch (Exception e) {
	e.printStackTrace();
	}
	
	}
	

	private class TablePanel extends JPanel implements PacketListener {
	/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
	JTable table;
	Object[] headers = {
	"Adresse IP source",
	"Adresse IP destination",
	"Data",
	"Protocol"
	};

	public TablePanel() {
	table = new JTable(new DefaultTableModel(null, headers));
	add(new JScrollPane(table));
	}

	public void packetArrived(Packet packet) {
		try {
		
			
		if (packet instanceof IPPacket) {
	IPPacket ip = (IPPacket)packet;
	
	String[] data = new String[] {
	ip.getSourceAddress(),
	ip.getDestinationAddress(),
	new String(ip.getData()),
	IPProtocol.getDescription(ip.getIPProtocol())
	};
	updateTable(data);
		}
		
		
		if (packet instanceof EthernetPacket) {
			EthernetPacket ethernetPacket = (EthernetPacket) packet;
			String[] data = new String[] {
			ethernetPacket.getSourceHwAddress(),ethernetPacket.getDestinationHwAddress()};
			}

			
		if (packet instanceof ARPPacket) {
				ARPPacket arpPacket = (ARPPacket) packet;
				String[] data = new String[] {arpPacket.getSourceProtoAddress(),arpPacket.getDestinationProtoAddress()};
			}

	
		}
	catch(Exception e) {
			e.printStackTrace();	
		}
	}


	public void updateTable(final String[] info) {
	SwingUtilities.invokeLater(new Runnable() {
	public void run() {
	DefaultTableModel model = (DefaultTableModel)table.getModel();
	model.addRow(info);
	}
	});
	
	}
	}
	}

Open in new window


help me !!
keviin55Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mick BarryJava DeveloperCommented:
its failing to find the jpcap properties file
wheat directory have you put it in?
0
keviin55Author Commented:
i have installed the jpcap librery at /usr/lib/jpcap-0.01.16 then i added it to build path.
0
Mick BarryJava DeveloperCommented:
what about the properties file, where is that?
SHould be in your project I think
0
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

vks_vickyCommented:
Yes the property file needs to be in the project root folder. Just place the properties file int the same place you have created your src
0
keviin55Author Commented:
thank you for your answer but i can find the proporties file haw can i find it please ?!
0
vks_vickyCommented:
In the root folder of jpcap library, there is a folder called properties and it contains two property files

simulator.properties
tool.properties

All the details are in that. And check the javadoc, most of the information is there on that

http://jpcap.sourceforge.net/javadoc/index-all.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.