boa.nl
Dec 17th, 2008, 05:34 AM
Hello,
I want to run my applet on Jbuilder, but if i run this application i get the following error :
Unable to start runtime due to invalid configuration
this is my code what i run :
package untitled2;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class Untitled1 extends Applet implements ActionListener {
TextField invoer;
Button plus, min;
int getal; // het ingelezen getal
// Plaats de grafische componenten
public void init() {
plus = new Button("Verhoog");
min = new Button("Verminder");
invoer = new TextField( 5 );
add( plus );
add( invoer);
add( min);
plus.addActionListener(this);
invoer.addActionListener(this);
min.addActionListener(this);
}
// Verwerk de events
public void actionPerformed ( ActionEvent e) {
// Stap1: Als plus-Voorraad dan verhoog getal met 1
if (e.getSource() == plus) {
// Stap2: increment
getal++;
}
// Stap3: Als min-Voorraad dan verlaag getal met 1
if (e.getSource() == min) {
// Stap4: decrement
getal--;
}
// Stap5: Als enter-toets dan lees en converteer getal
if (e.getSource() == invoer)
getal= Integer.parseInt( invoer.getText() );
// Stap6: schrjf getal in het textField invoer
invoer.setText(Integer.toString(getal));
}
}
Please help me :(
I want to run my applet on Jbuilder, but if i run this application i get the following error :
Unable to start runtime due to invalid configuration
this is my code what i run :
package untitled2;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class Untitled1 extends Applet implements ActionListener {
TextField invoer;
Button plus, min;
int getal; // het ingelezen getal
// Plaats de grafische componenten
public void init() {
plus = new Button("Verhoog");
min = new Button("Verminder");
invoer = new TextField( 5 );
add( plus );
add( invoer);
add( min);
plus.addActionListener(this);
invoer.addActionListener(this);
min.addActionListener(this);
}
// Verwerk de events
public void actionPerformed ( ActionEvent e) {
// Stap1: Als plus-Voorraad dan verhoog getal met 1
if (e.getSource() == plus) {
// Stap2: increment
getal++;
}
// Stap3: Als min-Voorraad dan verlaag getal met 1
if (e.getSource() == min) {
// Stap4: decrement
getal--;
}
// Stap5: Als enter-toets dan lees en converteer getal
if (e.getSource() == invoer)
getal= Integer.parseInt( invoer.getText() );
// Stap6: schrjf getal in het textField invoer
invoer.setText(Integer.toString(getal));
}
}
Please help me :(