Racine d'un projet java

Bonjour,
je veu utiliser une image dans mon projet java donc on m'a dit que l'image dans doit exister à la racine du projet.
ma quetion c'est:
c'est quoi la racine d'un projet java?
et oui je doit mettre les images exactement?
et merci d'avance.
Configuration: Windows Vista Internet Explorer 7.0

2 réponses

  1. la racine c'est le repertoire de base

    package com.yahoo.utilgui;

    donc la sur mon hdd sa donne
    /home/mel21lio/workspace/testPerf/
    dessous j'ais
    /com/yahoo/utilgui/maclass.java
    1. c'est faut tu mets l'images ou tu veux

      public JButton makeButton(String imageName, String actionCommand, String toolTipText, String altText) {
      // Look for the image.
      String imgLocation = "file://" + pwd + "src/main/resources/guiimg/" + imageName;
      URL imageURL = null;
      try {
      imageURL = new URL(imgLocation);
      } catch (MalformedURLException e) {
      e.printStackTrace();
      }
      ;

      ici le pwd represent bien ma racine de projet
      mais j'aurais put la foutre dans une clef usb
      String imgLocation = "file://media/usb/maclef/metsimages";