mira

j'essaye de mettre un systray en java à mon application dans la barre des taches .tout d'abord je dois connecter à la base de données de logiciel(Ipswitch) puis tester les cas d'échecs.voici le code:package Barre;
import java.awt.AWTException;
import java.awt.Image;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
import java.io.*;
import java.util.*;
public class Start
{
static Connection c;
static Statement stmt;
static ResultSet rs;
String query1;
int nMonitorStateID;
String sStateName;
int nInternalMonitorState;
int nInternalStateTime;
int nStateFillColor;
int nStateLineColor;
int nShapePoints;
double nShapeInnerRadius;
double nShapeOuterRadius;
double nShapeDirection;
boolean bSystemType;
public Start(int nMonitorStateID,String sStateName,int nInternalMonitorState,int nInternalStateTime,int nStateFillColor,int nStateLineColor,int nShapePoints,double nShapeInnerRadius,double nShapeOuterRadius,double nShapeDirection,boolean bSystemType)
{this.nMonitorStateID=nMonitorStateID;
this.sStateName=sStateName;
this.nInternalMonitorState=nInternalMonitorState;
this.nInternalStateTime=nInternalStateTime;
this.nStateFillColor=nStateFillColor;
this.nStateLineColor=nStateLineColor;
this.nShapePoints=nShapePoints;
this.nShapeInnerRadius=nShapeInnerRadius;
this.nShapeOuterRadius=nShapeOuterRadius;
this.nShapeDirection=nShapeDirection;
this.bSystemType=bSystemType;
}
/** Creates a new instance of personel */
void Panne()throws SQLException,ClassNotFoundException
{
Class.forName( "com.microsoft.sqlserver.jdbc.SQLServerDriver" );
Connection c = DriverManager.getConnection("jdbc:sqlserver://localhost/whatsup;user=NULL;password=NULL" );
stmt = c.createStatement();
query1="select * from whatsup.MonitorState ";
java.sql.ResultSet rs=stmt.executeQuery(query1);
while(rs.next()){
try
{ int n=1 ;
for(int i=0;i<n;i++)
{
if((rs.getString(2)=="Down at least 5 min")||(rs.getString(2)=="Down at least 2 min")||(rs.getString(2)=="Down")||(rs.getString(2)=="Maintenance")||(rs.getString(2)=="Down at least 20 min"))
{ final TrayIcon trayIcon;
if (SystemTray.isSupported()) {
SystemTray tray = SystemTray.getSystemTray();
Image image = Toolkit.getDefaultToolkit().getImage("duke.gif");
PopupMenu popup = new PopupMenu();
MenuItem defaultItem = new MenuItem("Quitter");
defaultItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
popup.add(defaultItem);
trayIcon = new TrayIcon(image, "Ipswitch Demo !", popup); // Création de l'icone systray
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
trayIcon.displayMessage("Ipswitch new feature !",
"machine not responding",
TrayIcon.MessageType.ERROR);
}
};
trayIcon.setImageAutoSize(true);
trayIcon.addActionListener(actionListener);
try {
tray.add(trayIcon);
} catch (AWTException e) {
e.printStackTrace();
}
} else {
System.exit(1);
}
}
}
}
catch(Exception e)
{e.printStackTrace();
}
}
}
public static void main (String args[])
{ try {
Start s = new Start(1,"Down at least 2 min",1,2,16776960,8421376,8,0.70,0.40,0.78,true);
s.Panne();
} catch(Exception e)
{e.printStackTrace();
}
}
}
à l'exécution de ce code j'ai les erreurs suivantes:
java.lang.NoClassDefFoundError: barre/Start (wrong name: Barre/Start)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"
(l'icone ne s'affiche plus).
que dois je faire?