Calculatrice
De Vincy
Messages postés
4
Statut
Membre
-
De Vincy Messages postés 4 Statut Membre -
De Vincy Messages postés 4 Statut Membre -
Bonjour à tous,
je débute en java et dois écrire une application web d'une calculatrice (avec seam et jsf). Je voudrais un coup de main pour écrire le code qui affiche le bouton cliqué et faire les calculs.
je débute en java et dois écrire une application web d'une calculatrice (avec seam et jsf). Je voudrais un coup de main pour écrire le code qui affiche le bouton cliqué et faire les calculs.
Configuration: Linux Firefox 3.0.12
4 réponses
-
Bonjour !
Où en es-tu ? Poste ce que tu as déjà fait, entre balises ! -
J'ai seulement fait l'interface graphique que voici:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="https://www.redhat.com/en/topics/middleware" xmlns:ui="https://www.oracle.com/java/technologies/" xmlns:f="https://www.oracle.com/java/technologies/" xmlns:h="https://www.oracle.com/java/technologies/" xmlns:rich="https://richfaces.jboss.org/" template="layout/template.xhtml"> <ui:define name="body"> <h:form> <h1>Calculatrice</h1> <rich:panel style=" width : 260px;"> <rich:panel style=" width : 240px;"> <h:inputText id="ecran" value="#{ecran.initial}" style=" height : 40px; width : 200px;"/> </rich:panel> <s:div styleClass="info"> <rich:panel style=" width : 240px;"> <h:panelGrid columns="3"> <s:div> <s:div> <h:commandButton id="seven" value="7" style=" width : 35px;"/> <h:commandButton id="eight" value="8" style=" width : 35px;"/> <h:commandButton id="nine" value="9" style=" width : 35px;"/> </s:div> <s:div> <h:commandButton id="four" value="4" style=" width : 35px;"/> <h:commandButton id="five" value="5" style=" width : 35px;"/> <h:commandButton id="six" value="6" style=" width : 35px;"/> </s:div> <s:div> <h:commandButton id="one" value="1" style=" width : 35px;"/> <h:commandButton id="two" value="2" style=" width : 35px;"/> <h:commandButton id="three" value="3" style=" width : 35px;"/> </s:div> <s:div> <h:commandButton id="zero" value="0" style=" width : 35px;"/> <h:commandButton id="plusmoins" value="+/-" style=" width : 35px;"/> <h:commandButton id="fullstop" value="." style=" width : 35px;"/> </s:div> </s:div> <s:div style="width : 29px; height : 100px;"> <h:commandButton id="diviser" value="/" style=" width : 35px;"/> <h:commandButton id="multiplier" value="*" style=" width : 35px;"/> <h:commandButton id="moins" value="-" style=" width : 35px;"/> <h:commandButton id="plus" value="+" style=" width : 35px;"/> </s:div> <s:div style=" height : 95px;"> <rich:spacer style=" width : 8px"/> <h:commandButton id="equal" value="=" style="width : 35px; height : 94px;"/> </s:div> </h:panelGrid> </rich:panel> </s:div> </rich:panel> </h:form> </ui:define> </ui:composition>
C'est l'action des boutons en java qu'il me faut. Merci. -
Je ne comprends pas : tu ne dois pas faire une applet plutôt ?
-
Non, c'est une application qui respecte l'architecture MVC. c'est la Vue que j'ai posté. Il me reste à écrire le Controleur pour avoir une calculatrice qui fonctionne.