You are not logged in.
Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
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 |
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class SpannungUI extends Applet
implements ActionListener
{
private spannung S1 = new SpannungCalc();
private Button ButtonRechne = new Button ("Rechne");
private TextField TextFieldStrom = new TextField (15);
private TextField TextFieldLeistung = new TextField (15);
private Label LabelSpannung = new Label ("Spannung");
private Label LabelStrom = new Label ("Strom");
private Label LabelLeistung = new Label ("Leistung");
public void init()
{
this.add (LabelSpannung);
this.add (LabelStrom);
this.add (TextFieldStrom);
this.add (LabelLeistung);
this.add (TextFieldLeistung);
this.add (ButtonRechne);
ButtonRechne.addActionListener(this);
}
public void actionPerformed( ActionEvent e)
{
}
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public class Spannung {
private float fSpannung;
public void Calc(float fLeistung, float fStrom)
{
fSpannung = fLeistung / fStrom;
}
public int getSpannung( )
{
return fSpannung;
}
|
crushcoder
God






Gott hat die Welt ja nur in sieben Tagen erschaffen können, weil es keine installierte Basis gab.
This post has been edited 1 times, last edit by "Y0Gi" (Jan 22nd 2013, 4:07am)
crushcoder
God





Quoted from "Y0Gi"
Kleinschreibung am Anfang, aber mixedCase ist OK. Wird sonst etwas unleserlich und underscore_separated ist bei Java meines Wissens sehr wenig verbreitet.
Gott hat die Welt ja nur in sieben Tagen erschaffen können, weil es keine installierte Basis gab.
-