kommt da noch was? Oder sollen wir jetzt hier
http://www.java-forum.org/de/viewtopic.php?t=40483&highlight=
weitermachen :roll: ?
http://www.java-forum.org/de/viewtopic.php?t=40483&highlight=
weitermachen :roll: ?
Azrahel hat gesagt.:Werd ich jetzt aus dem Forum verbannt wegen Zynismus?
SniperWolf26 hat gesagt.:Hi gib mir mal deine Mail Adresse und ich schick Dir das Programm zu....
package Konzentrationstest;
import java.awt.*;
public class ZiffernFeld
{
protected int xMitte;
protected int yMitte;
protected Color farbe;
private char ziffer;
private Font font;
public ZiffernFeld(int i, int j, Color color)
{
xMitte = i;
yMitte = j;
farbe = color;
ziffer = '\0'; //Keine Ziffer
// ziffer = 'a'; //Eine Ziffer
// System.out.println("Ausgabe"+ziffer);
font = new Font("Times New Roman", Font.BOLD, 72);
}
public void waehleZiffer()
{
ziffer = (char)(97 + (int)(Math.random() * 25D));
}
public char gibZiffer()
{
return ziffer;
}
public void zeichne(Graphics g)
{
g.setFont(font);
g.setColor(farbe);
FontMetrics fontmetrics = g.getFontMetrics(font);
// String s = ""+ziffer;
String s = (ziffer!='\0') ? "" + ziffer : "";
g.drawString(s, xMitte - fontmetrics.stringWidth(s) / 2, yMitte + fontmetrics.getAscent() / 2);
}
public static void main(String[] _)
{
new ZiffernFeld(200,200,Color.RED);
}
}
SniperWolf26 hat gesagt.:Ich habe 1 mal ZiffernFeld möchte jemand tauschen? :wink: