| 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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import com.symantec.itools.javax.swing.JCurrencyTextField; import com.symantec.itools.javax.swing.JWrappingLabel; import com.symantec.itools.javax.swing.actions.JActionButton; import com.symantec.itools.javax.swing.JBorderlessButton; public class Applet1 extends Applet { public void init() { // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller symantec.itools.lang.Context.setApplet(this); // This code is automatically generated by Visual Cafe when you add // components to the visual environment. It instantiates and initializes // the components. To modify the code, only use code syntax that matches // what Visual Cafe can generate, or Visual Cafe may be unable to back // parse your Java file into its visual environment. //{{INIT_CONTROLS setLayout(null); setBackground(java.awt.Color.lightGray); setSize(637,413); add(TellerVeld); TellerVeld.setBounds(120,48,193,62); add(NoemerVeld); NoemerVeld.setBounds(120,180,193,62); add(UitkomstVeld); UitkomstVeld.setBounds(120,300,193,62); try { JWrappingLabel1.setText("Invoer Teller : "); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel1.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel1); JWrappingLabel1.setFont(new Font("Dialog", Font.PLAIN, 20)); JWrappingLabel1.setBounds(12,48,84,60); try { JWrappingLabel2.setText("Invoer noemer : "); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel2.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel2); JWrappingLabel2.setFont(new Font("Dialog", Font.PLAIN, 20)); JWrappingLabel2.setBounds(12,180,84,72); try { JWrappingLabel3.setText("Uitkomst : "); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel3.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel3); JWrappingLabel3.setFont(new Font("Dialog", Font.PLAIN, 20)); JWrappingLabel3.setBounds(12,312,84,36); PlusButton.setText("+"); add(PlusButton); PlusButton.setBounds(360,312,51,53); MinButton.setText("-"); add(MinButton); MinButton.setBounds(432,312,51,53); MaalButton.setText("X"); add(MaalButton); MaalButton.setBounds(504,312,51,53); DeelButton.setText(":"); add(DeelButton); DeelButton.setBounds(576,312,51,53); //}} //{{REGISTER_LISTENERS SymAction lSymAction = new SymAction(); TellerVeld.addActionListener(lSymAction); NoemerVeld.addActionListener(lSymAction); PlusButton.addActionListener(lSymAction); MinButton.addActionListener(lSymAction); MaalButton.addActionListener(lSymAction); DeelButton.addActionListener(lSymAction); //}} } //{{DECLARE_CONTROLS com.symantec.itools.javax.swing.JCurrencyTextField TellerVeld = new com.symantec.itools.javax.swing.JCurrencyTextField(); com.symantec.itools.javax.swing.JCurrencyTextField NoemerVeld = new com.symantec.itools.javax.swing.JCurrencyTextField(); com.symantec.itools.javax.swing.JCurrencyTextField UitkomstVeld = new com.symantec.itools.javax.swing.JCurrencyTextField(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel1 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel2 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel3 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JBorderlessButton PlusButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton MinButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton MaalButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton DeelButton = new com.symantec.itools.javax.swing.JBorderlessButton(); //}} class SymAction implements java.awt.event.ActionListener { public void actionPerformed(java.awt.event.ActionEvent event) { Object object = event.getSource(); if (object == TellerVeld) TellerVeld_actionPerformed(event); else if (object == NoemerVeld) NoemerVeld_actionPerformed(event); else if (object == PlusButton) PlusButton_actionPerformed(event); else if (object == MinButton) MinButton_actionPerformed(event); else if (object == MaalButton) MaalButton_actionPerformed(event); else if (object == DeelButton) DeelButton_actionPerformed(event); } } void TellerVeld_actionPerformed(java.awt.event.ActionEvent event) { // to do: code goes here. } void NoemerVeld_actionPerformed(java.awt.event.ActionEvent event) { // to do: code goes here. } void PlusButton_actionPerformed(java.awt.event.ActionEvent event) { String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n + t; UitkomstVeld.setText("" + u); // Hij doet de noemer + de teller en geeft de uitslag. } void MinButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n - t; UitkomstVeld.setText("" + u); // Hij doet de noemer - de teller en geeft vervolgens de uitslag. } void MaalButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n * t; UitkomstVeld.setText("" + u); // Hij vermenigvuldigd de noemer met de teller, en geeft vervolgens de uitslag. } void DeelButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n / t; UitkomstVeld.setText("" + u); // Hij deelt de noemer door de teller. en geeft vervolgens de uitslag. } } |
Ja, code is idd niks maja, da's Visual Cafe eigenquote:Op vrijdag 24 februari 2006 22:33 schreef gelly het volgende:
Maar is dat de code die VisualCafe ervan maakt joh ? Wat een zooi.
Heb je niet toevallig een vinkje aangezet (of wat aanstond) toen je de velden neerzette? Want nu hebben al die velden de eigenschap dat ze currency velden zijn terwijl je eigenlijk gewone textfields wilt. Je zou dit handmatig kunnen veranderen maar is er niet in de lijst met opties die je bij zo'n veld hebt een vinkje wat je uit kan zetten om dat te veranderen?quote:Op vrijdag 24 februari 2006 22:50 schreef Messenga het volgende:
Ik zou het het liefst ook anders doen, maar dat mag niet.
hoe los ik het nu op?
| 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 | // to do: code goes here. } void PlusButton_actionPerformed(java.awt.event.ActionEvent event) { String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n + t; UitkomstVeld.setText("" + u); // Hij doet de noemer + de teller en geeft de uitslag. } void MinButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n - t; UitkomstVeld.setText("" + u); // Hij doet de noemer - de teller en geeft vervolgens de uitslag. } void MaalButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n * t; UitkomstVeld.setText("" + u); // Hij vermenigvuldigd de noemer met de teller, en geeft vervolgens de uitslag. } void DeelButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n / t; UitkomstVeld.setText("" + u); // Hij deelt de noemer door de teller. en geeft vervolgens de uitslag. } } |
| 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 147 148 149 150 151 152 153 154 155 156 | A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import com.symantec.itools.javax.swing.JBox; import com.symantec.itools.javax.swing.JCurrencyTextField; import com.symantec.itools.javax.swing.JMaskedTextField; import com.symantec.itools.javax.swing.JBorderlessButton; import com.symantec.itools.javax.swing.JWrappingLabel; import com.symantec.itools.javax.swing.actions.JActionButton; public class Applet1 extends Applet { public void init() { // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller symantec.itools.lang.Context.setApplet(this); // This code is automatically generated by Visual Cafe when you add // components to the visual environment. It instantiates and initializes // the components. To modify the code, only use code syntax that matches // what Visual Cafe can generate, or Visual Cafe may be unable to back // parse your Java file into its visual environment. //{{INIT_CONTROLS setLayout(null); setSize(623,504); add(NoemerVeld); NoemerVeld.setBounds(144,228,144,36); try { JWrappingLabel1.setText("Invoer Teller"); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel1.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel1); JWrappingLabel1.setFont(new Font("Dialog", Font.BOLD, 20)); JWrappingLabel1.setBounds(24,84,85,72); try { JWrappingLabel2.setText("Invoer Noemer"); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel2.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel2); JWrappingLabel2.setFont(new Font("Dialog", Font.BOLD, 20)); JWrappingLabel2.setBounds(36,216,85,72); try { JWrappingLabel3.setText("Uitkomst"); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel3.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel3); JWrappingLabel3.setFont(new Font("Dialog", Font.BOLD, 20)); JWrappingLabel3.setBounds(24,372,95,42); add(UitkomstVeld); UitkomstVeld.setBounds(144,360,144,48); add(TellerVeld); TellerVeld.setBounds(132,108,144,36); MinButton.setText("-"); add(MinButton); MinButton.setBounds(432,360,48,48); MaalButton.setText("X"); add(MaalButton); MaalButton.setBounds(492,360,48,48); DeelButton.setText(":"); add(DeelButton); DeelButton.setBounds(552,360,48,48); PlusButton.setText("+"); add(PlusButton); PlusButton.setBounds(360,360,48,48); add(NoemerVeld); //}} } //{{DECLARE_CONTROLS com.symantec.itools.javax.swing.JCurrencyTextField NoemerVeld = new com.symantec.itools.javax.swing.JCurrencyTextField(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel1 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel2 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel3 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JCurrencyTextField UitkomstVeld = new com.symantec.itools.javax.swing.JCurrencyTextField(); com.symantec.itools.javax.swing.JCurrencyTextField TellerVeld = new com.symantec.itools.javax.swing.JCurrencyTextField(); com.symantec.itools.javax.swing.JBorderlessButton MinButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton MaalButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton DeelButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton PlusButton = new com.symantec.itools.javax.swing.JBorderlessButton(); //}} void TellerVeld_actionPerformed(java.awt.event.ActionEvent event) { // to do: code goes here. } void NoemerVeld_actionPerformed(java.awt.event.ActionEvent event) { // to do: code goes here. } void PlusButton_actionPerformed(java.awt.event.ActionEvent event) { String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n + t; UitkomstVeld.setText("" + u); // Hij doet de noemer + de teller en geeft de uitslag. } void MinButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n - t; UitkomstVeld.setText("" + u); // Hij doet de noemer - de teller en geeft vervolgens de uitslag. } void MaalButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n * t; UitkomstVeld.setText("" + u); // Hij vermenigvuldigd de noemer met de teller, en geeft vervolgens de uitslag. } void DeelButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n / t; UitkomstVeld.setText("" + u); // Hij deelt de noemer door de teller. en geeft vervolgens de uitslag. } } |
| 1 |
| 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 147 148 149 150 151 152 153 154 155 | A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; import com.symantec.itools.javax.swing.JBox; import com.symantec.itools.javax.swing.JCurrencyTextField; import com.symantec.itools.javax.swing.JMaskedTextField; import com.symantec.itools.javax.swing.JBorderlessButton; import com.symantec.itools.javax.swing.JWrappingLabel; import com.symantec.itools.javax.swing.actions.JActionButton; public class Applet1 extends Applet { public void init() { // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller symantec.itools.lang.Context.setApplet(this); // This code is automatically generated by Visual Cafe when you add // components to the visual environment. It instantiates and initializes // the components. To modify the code, only use code syntax that matches // what Visual Cafe can generate, or Visual Cafe may be unable to back // parse your Java file into its visual environment. //{{INIT_CONTROLS setLayout(null); setSize(623,504); try { JWrappingLabel1.setText("Invoer Teller"); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel1.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel1); JWrappingLabel1.setFont(new Font("Dialog", Font.BOLD, 20)); JWrappingLabel1.setBounds(24,84,85,72); try { JWrappingLabel2.setText("Invoer Noemer"); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel2.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel2); JWrappingLabel2.setFont(new Font("Dialog", Font.BOLD, 20)); JWrappingLabel2.setBounds(36,216,85,72); try { JWrappingLabel3.setText("Uitkomst"); } catch(java.beans.PropertyVetoException e) { } try { JWrappingLabel3.setTextAlignment(javax.swing.SwingConstants.CENTER); } catch(java.beans.PropertyVetoException e) { } add(JWrappingLabel3); JWrappingLabel3.setFont(new Font("Dialog", Font.BOLD, 20)); JWrappingLabel3.setBounds(24,372,95,42); MinButton.setText("-"); add(MinButton); MinButton.setBounds(432,360,48,48); MaalButton.setText("X"); add(MaalButton); MaalButton.setBounds(492,360,48,48); DeelButton.setText(":"); add(DeelButton); DeelButton.setBounds(552,360,48,48); PlusButton.setText("+"); add(PlusButton); PlusButton.setBounds(360,360,48,48); add(TellerVeld); TellerVeld.setBounds(144,84,205,56); add(NoemerVeld); NoemerVeld.setBounds(144,216,205,56); add(UitkomstVeld); UitkomstVeld.setBounds(132,360,205,56); //}} } //{{DECLARE_CONTROLS com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel1 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel2 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JWrappingLabel JWrappingLabel3 = new com.symantec.itools.javax.swing.JWrappingLabel(); com.symantec.itools.javax.swing.JBorderlessButton MinButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton MaalButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton DeelButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JBorderlessButton PlusButton = new com.symantec.itools.javax.swing.JBorderlessButton(); com.symantec.itools.javax.swing.JMaskedTextField TellerVeld = new com.symantec.itools.javax.swing.JMaskedTextField(); com.symantec.itools.javax.swing.JMaskedTextField NoemerVeld = new com.symantec.itools.javax.swing.JMaskedTextField(); com.symantec.itools.javax.swing.JMaskedTextField UitkomstVeld = new com.symantec.itools.javax.swing.JMaskedTextField(); //}} void TellerVeld_actionPerformed(java.awt.event.ActionEvent event) { // to do: code goes here. } void NoemerVeld_actionPerformed(java.awt.event.ActionEvent event) { // to do: code goes here. } void PlusButton_actionPerformed(java.awt.event.ActionEvent event) { String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n + t; UitkomstVeld.setText("" + u); // Hij doet de noemer + de teller en geeft de uitslag. } void MinButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n - t; UitkomstVeld.setText("" + u); // Hij doet de noemer - de teller en geeft vervolgens de uitslag. } void MaalButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n * t; UitkomstVeld.setText("" + u); // Hij vermenigvuldigd de noemer met de teller, en geeft vervolgens de uitslag. } void DeelButton_actionPerformed(java.awt.event.ActionEvent event) {String noemer = NoemerVeld.getText(); String teller = TellerVeld.getText(); int n = Integer.parseInt(noemer); int t = Integer.parseInt(teller); int u = n / t; UitkomstVeld.setText("" + u); // Hij deelt de noemer door de teller. en geeft vervolgens de uitslag. } } |
| Forum Opties | |
|---|---|
| Forumhop: | |
| Hop naar: | |