Code: Alles auswählen
// Knopf Klasse
public class Knopf
{
Rectangle rect = new Rectangle(); // Umrandung als Rechteck
String text = new String(); // Inhalt als String
int textX, textY; // Position des Strings
}
Code: Alles auswählen
// Knoepfe festlegen
this.knopf = new Knopf[5];
this.knopf[0].rect.x = 20;
this.knopf[0].text = "R"; // Rechteck
this.knopf[0].textX = 25;
this.knopf[1].rect.x = 45;
this.knopf[1].text = "K"; // Kreis
this.knopf[1].textX = 50;
this.knopf[2].rect.x = 70;
this.knopf[2].text = "D"; // Dreieck
this.knopf[2].textX = 75;
this.knopf[3].rect.x = 95;
this.knopf[3].text = "T"; // Text
this.knopf[3].textX = 100;
this.knopf[4].rect.x = 120;
this.knopf[4].text = "P"; // Polylinie
this.knopf[4].textX = 125;
for( int i = 0; i < knopf.length; i++ )
{
knopf[i].textY = 40;
knopf[i].rect.y = 40;
knopf[i].rect.height = 20;
knopf[i].rect.width = 20;
}
Danke im Vorraus...