blob: a8ee76a1e2adf0f0b664a3985857f00c060e15de (
plain)
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
|
/* Listing2704.java */
import java.awt.*;
import java.awt.event.*;
public class Listing2704
extends Frame
{
public static void main(String[] args)
{
Listing2704 wnd = new Listing2704();
wnd.setSize(300,200);
wnd.setLocation(50,50);
wnd.setVisible(true);
}
public Listing2704()
{
super("");
assignTitle();
assignIcon();
assignCursor();
assignColors();
assignFont();
addWindowListener(new WindowClosingAdapter(true));
}
private void assignTitle()
{
setTitle("Ver�nderte Fensterelemente");
}
private void assignIcon()
{
Image img = getToolkit().getImage("testicon.gif");
MediaTracker mt = new MediaTracker(this);
mt.addImage(img, 0);
try {
//Warten, bis das Image vollst�ndig geladen ist,
mt.waitForAll();
} catch (InterruptedException e) {
//nothing
}
setIconImage(img);
}
private void assignCursor()
{
setCursor(new Cursor(Cursor.WAIT_CURSOR));
}
private void assignColors()
{
setForeground(Color.white);
setBackground(Color.black);
}
private void assignFont()
{
setFont(new Font("Serif", Font.PLAIN, 28));
}
public void paint(Graphics g)
{
g.drawString("Test in Vordergrundfarbe",10,70);
}
}
|