IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaFX Discussion :

Lignes vides lors de l'ajout de nouvelles lignes dans TableView JavaFX


Sujet :

JavaFX

  1. #1
    Nouveau Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2013
    Messages : 1
    Points : 1
    Points
    1
    Par défaut Lignes vides lors de l'ajout de nouvelles lignes dans TableView JavaFX
    Bonjour,
    Je débute en JAVA et je rencontre depuis près de 3 jours un problème lors de l'ajout de nouvelles lignes dans mon mon tableau fait sous scene Builder.
    Lors de l'exécution du code, les lignes apparaissent vident.

    ******* Le modèle
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.property.StringProperty;
     
    public class InvoiceEntry {
     
        private final SimpleStringProperty colstatuta;
        private final SimpleStringProperty coldathra; 
        private final SimpleStringProperty coldestia;
        private final SimpleStringProperty colmsga;
        private final SimpleStringProperty colexpda;
     
     
        public InvoiceEntry(String statut,String dathr,String desti,String msg,String expd) {
            this.colstatuta = new SimpleStringProperty(statut);
            this.coldathra = new SimpleStringProperty(dathr);
            this.coldestia = new SimpleStringProperty(desti);
            this.colmsga = new SimpleStringProperty(msg);
            this.colexpda = new SimpleStringProperty(expd);
        }
     
        public String getcolstatut() {
            return colstatuta.get();
        }
     
        public String getcoldathr() {
            return coldathra.get();
        }
     
        public String getcoldesti() {
            return coldestia.get();
        }
     
        public String getcolmsg() {
            return colmsga.get();
        }
     
        public String getcolexpd() {
            return colexpda.get();
        }
     
     
        public void setstatut(String statut) {
            colstatuta.set(statut);
        }
     
        public void setdathr(String dathr) {
            coldathra.set(dathr);
        }
     
        public void setdesti(String desti) {
            coldestia.set(desti);
        }
     
        public void setmsg(String msg) {
            colmsga.set(msg);
        }
     
        public void setexpd(String expd) {
            colexpda.set(expd);
        }
     
            public StringProperty statutProperty() {
                return colstatuta;
            }
     
            public StringProperty dathrProperty() {
                return coldathra;
            }
     
            public StringProperty destiProperty() {
                return coldestia;
            }
     
            public StringProperty msgProperty() {
                return colmsga;
            }
     
            public StringProperty expdProperty() {
                return colexpda;
            }

    ******** Mon controlleur
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
        @FXML
        private TableView<InvoiceEntry> listrapport;
        @FXML
        private TableColumn<InvoiceEntry, String> colstatuta;
        @FXML
        private TableColumn<InvoiceEntry, String> coldathra;
        @FXML
        private TableColumn<InvoiceEntry, String> coldestia;
        @FXML
        private TableColumn<InvoiceEntry, String> colmsga;
        @FXML
        private TableColumn<InvoiceEntry, String> colexpda;
     
        private ObservableList<InvoiceEntry> datas;
     
     
     
        @Override
        public void initialize(URL url, ResourceBundle rb) {
     
     
           colstatuta.setCellValueFactory(new PropertyValueFactory<>("colstatuta"));
           coldathra.setCellValueFactory(new PropertyValueFactory<>("coldathra"));
           coldestia.setCellValueFactory(new PropertyValueFactory<>("coldestia"));
           colmsga.setCellValueFactory(new PropertyValueFactory<>("colmsga"));
           colexpda.setCellValueFactory(new PropertyValueFactory<>("colexpda"));
     
     
           datas = FXCollections.observableArrayList();
           datas.add(new InvoiceEntry("Jacob", "Smith", "jacob.smith@example.com", "popopop", 
            "ererree"));
     
           listrapport.setItems(datas);
     
        }

  2. #2
    Rédacteur/Modérateur

    Avatar de bouye
    Homme Profil pro
    Information Technologies Specialist (Scientific Computing)
    Inscrit en
    Août 2005
    Messages
    6 840
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : Nouvelle-Calédonie

    Informations professionnelles :
    Activité : Information Technologies Specialist (Scientific Computing)
    Secteur : Agroalimentaire - Agriculture

    Informations forums :
    Inscription : Août 2005
    Messages : 6 840
    Points : 22 854
    Points
    22 854
    Billets dans le blog
    51
    Par défaut
    Bonjour,
    le soucis ne serait-il dans l'orthographe de tes getters dans ta classe InvoiceEntry ? Il semble te manquer la majuscule sur la première lettre de la propriété dans le nom du getter.

    Ex : getColstatut() au lieu de getcolstatut()
    Merci de penser au tag quand une réponse a été apportée à votre question. Aucune réponse ne sera donnée à des messages privés portant sur des questions d'ordre technique. Les forums sont là pour que vous y postiez publiquement vos problèmes.

    suivez mon blog sur Développez.

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning. ~ Rich Cook

Discussions similaires

  1. Ligne vide lors du chargement d'un liste déroulante
    Par Trebor_ dans le forum Langage
    Réponses: 2
    Dernier message: 15/03/2008, 13h26
  2. Ajouter une nouvelle ligne sous la cellule actuellement sélectionnée
    Par agronomia dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 22/02/2008, 09h50
  3. message "Vous allez ajouter une nouvelle ligne"
    Par Rizel dans le forum VBA Access
    Réponses: 3
    Dernier message: 07/09/2007, 14h10
  4. Problèmes lors de l'ajout de nouvelles polices windows
    Par spynux dans le forum Windows XP
    Réponses: 9
    Dernier message: 01/08/2007, 22h01
  5. Réponses: 7
    Dernier message: 11/06/2007, 20h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo