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 :

Problème pour récupérer la saisie dans JFXDatePicker


Sujet :

JavaFX

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Développeur en alternance
    Inscrit en
    Décembre 2016
    Messages
    112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Développeur en alternance
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2016
    Messages : 112
    Par défaut Problème pour récupérer la saisie dans JFXDatePicker
    L'utilisateur doit envoyer tout ce qu'il a créer et décider la période de temps de son scénario, l'utilisateur choisit l'heure de début et l'heure de fin grâce a deux JFXDatePicker ces heures sont envoyer dans un URL mais a chaque fois dans l'url les valeurs d’heure son nuls et je ne comprends pas pourquoi.
    code du bouton qui envoie la requete GET
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    @FXML     
        private void actionActiver(){
     
            Socket client=new Socket();
            String nomS=nomXML.toString();  //La variable global nom passe de Optional<String> en String        
            try {
            //heureDebut et heureFin sont les JFXDatePicker
                client.envoiRequete(chemFichier,nomS,heureDebut.getAccessibleText(),heureFin.getAccessibleText());   //On essaye de faire la méthode pour envoyer la requete
            } catch (IOException ex) {
                Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);  //si jamais on y arrive pas on a une exception 
            }     
        }
    code de la fonction envoiRequete
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
        void envoiRequete(String chemXML,String nom, String hDebut,String hFin) throws IOException {
            // TODO code application logic here
            String chemServeur="http://192.168.0.216/resultat.php?&cheminXML="; //debut chemint du serveur
            String heureDebut="&heureDebut="+hDebut;     //on attribue l'heure du début au chemin qui sera envoyé
            String heureFin="&heureFin="+hFin;          //on attribue l'heure de fin au chemin qui sera envoyé
            String nomXML="&nomXML="+nom;                 //on attribue le nom du XML au chemin qui sera envoyé
            URI uri = URI.create(chemServeur+chemXML+heureDebut+heureFin+nomXML); //on envoie le chemin
            Desktop.getDesktop().browse(uri); //ouverture dans un navigateur
        }
    A chaque fois la valeur est null alors que je choisit les heures...et la documentation sur JFXDatePicker est très faible..

  2. #2
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Billets dans le blog
    2
    Par défaut
    Salut,

    Tout ce qui contient le mot "accessible" concerne, en général, l'accessibilité (l'adaptabilité d'un composant d'UI à ceux qui ont une vue limitée, ou sont aveugles, ou plus généralement, ceux qui ont des affectations ou des privations de sens). getAccessibleText est censé retourner le texte lu par le screenreader pour indiquer au malvoyant/nonvoyant à quoi sert le champ de saisie. Donc pas étonnant que tu ne récupères pas de date saisie par cette méthode (cela dit, cela montre que ton application n'est pas accessible...).

    Pour récupérer la saisie c'est la méthode getValue(). Si la doc de JFXDatePicker est succincte, tu peux voir qu'il étend le DatePicker de JavaFX et donc te référer déjà à sa doc. Il te faudra la formater probablement pour la passer en paramètre de ton URL, par DateTimeFormatter.
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  3. #3
    Membre confirmé
    Homme Profil pro
    Développeur en alternance
    Inscrit en
    Décembre 2016
    Messages
    112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Développeur en alternance
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2016
    Messages : 112
    Par défaut
    J'ai formaté le temps mais y a des exceptions à chaque test
    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
        @FXML     
        private void actionActiver(){
     
            Socket client=new Socket();
            String nomS=nomXML.toString();  //La variable global nom passe de Optional<String> en String
            LocalDate hDebut =heureDebut.getValue();
            String text = hDebut.format(DateTimeFormatter.ISO_LOCAL_TIME);
            LocalDate parsedDateDebut = LocalDate.parse(text, DateTimeFormatter.ISO_LOCAL_TIME);
            String hD=parsedDateDebut.toString();
            LocalDate hFin =heureFin.getValue();
            String text2 = hFin.format(DateTimeFormatter.ISO_LOCAL_TIME);
            LocalDate parsedDateFin = LocalDate.parse(text2, DateTimeFormatter.ISO_LOCAL_TIME);
            String hF=parsedDateFin.toString();
            try {
                client.envoiRequete(chemFichier,nomS,hD,hF);   //On essaye de faire la méthode pour envoyer la requete
            } catch (IOException ex) {
                Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);  //si jamais on y arrive pas on a une exception 
            }     
        }
    Mon application n'est pas accessible ? Qu'est ce que ça veut dire ?

  4. #4
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Billets dans le blog
    2
    Par défaut
    Citation Envoyé par Java Ou Javapas Voir le message
    J'ai formaté le temps mais y a des exceptions à chaque test
    Quelles exceptions ?


    Citation Envoyé par Java Ou Javapas Voir le message
    Mon application n'est pas accessible ? Qu'est ce que ça veut dire ?
    Tutoriel pour rendre son application Swing accessible aux non-voyants (la version JavaFX est en préparation il me semble).
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

  5. #5
    Membre confirmé
    Homme Profil pro
    Développeur en alternance
    Inscrit en
    Décembre 2016
    Messages
    112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Développeur en alternance
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2016
    Messages : 112
    Par défaut
    toute celle la :
    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
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    	at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774)
    	at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
    	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    	at javafx.event.Event.fireEvent(Event.java:198)
    	at javafx.scene.Node.fireEvent(Node.java:8411)
    	at javafx.scene.control.Button.fire(Button.java:185)
    	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
    	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
    	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
    	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
    	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    	at javafx.event.Event.fireEvent(Event.java:198)
    	at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
    	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
    	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
    	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:388)
    	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
    	at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
    	at com.sun.glass.ui.View.notifyMouse(View.java:937)
    	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
    	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
    	at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771)
    	... 56 more
    Caused by: java.lang.NullPointerException
    	at fr.packagea.FXMLDocumentController.actionTerminer(FXMLDocumentController.java:219)
    	... 66 more
    Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    	at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774)
    	at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
    	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    	at javafx.event.Event.fireEvent(Event.java:198)
    	at javafx.scene.Node.fireEvent(Node.java:8411)
    	at javafx.scene.control.Button.fire(Button.java:185)
    	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
    	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
    	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
    	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
    	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    	at javafx.event.Event.fireEvent(Event.java:198)
    	at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
    	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
    	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
    	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:388)
    	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
    	at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
    	at com.sun.glass.ui.View.notifyMouse(View.java:937)
    	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
    	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
    	at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771)
    	... 56 more
    Caused by: java.lang.NullPointerException
    	at fr.packagea.FXMLDocumentController.actionActiver(FXMLDocumentController.java:190)
    	... 66 more

  6. #6
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Billets dans le blog
    2
    Par défaut
    ESt-ce que les champs "date" pourraient être vide, donc heureDebut null par exemple ? Ce qui provoquerait la NullPointerException... Sinon, il y a autre chose de null, forcéement... et on sait que c'est à la ligne 219 et 190 de FXMLDocumentController (client peut-être ?).

    Par ailleurs,
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    LocalDate hDebut =heureDebut.getValue();
    String text = hDebut.format(DateTimeFormatter.ISO_LOCAL_TIME);
    LocalDate parsedDateDebut = LocalDate.parse(text, DateTimeFormatter.ISO_LOCAL_TIME);
    String hD=parsedDateDebut.toString();
    Il n'y a rien qui t'interpelle dans ce truc ?
    1. heureDebut (champ de saisie) -> hDebut (LocalDate)
    2. hDebut (LocalDate) -> text (format ISO)
    3. text (format ISO) -> parseDateDebut (LocalDate), donc parseDateDebut = heureDebut
    4. parsedDateDebut (LocalDate) -> hD (String, format de base, donc probablement foireux).


    Autant écrire ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    String hD = heureDebut.getValue().toString();
    ça donnera le même résultat en une seule ligne de code (avec un format non maitrisé, donc possiblement foireux, et la NPE aussi).
    L'expression "ça marche pas" ne veut rien dire. Indiquez l'erreur, et/ou les comportements attendus et obtenus, et donnez un Exemple Complet Minimal qui permet de reproduire le problème.
    La plupart des réponses à vos questions sont déjà dans les FAQs ou les Tutoriels, ou peut-être dans une autre discussion : utilisez la recherche interne.
    Des questions sur Java : consultez le Forum Java. Des questions sur l'EDI Eclipse ou la plateforme Eclipse RCP : consultez le Forum Eclipse.
    Une question correctement posée et rédigée et vous aurez plus de chances de réponses adaptées et rapides.
    N'oubliez pas de mettre vos extraits de code entre balises CODE (Voir Mode d'emploi de l'éditeur de messages).
    Nouveau sur le forum ? Consultez Les Règles du Club.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème pour récupérer un tableau dans un JSON
    Par eristoff72 dans le forum Android
    Réponses: 1
    Dernier message: 03/02/2017, 19h12
  2. Réponses: 6
    Dernier message: 28/12/2007, 22h34
  3. [MySQL] problème pour récupérer un identifiant dans la base
    Par leclone dans le forum PHP & Base de données
    Réponses: 4
    Dernier message: 12/03/2007, 09h54
  4. Réponses: 12
    Dernier message: 25/06/2006, 23h24
  5. problème pour récupérer une valeur dans ma bd (débutante)
    Par auryn111 dans le forum Langage SQL
    Réponses: 1
    Dernier message: 26/08/2005, 17h49

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