-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColour.java
More file actions
31 lines (23 loc) · 1008 Bytes
/
Colour.java
File metadata and controls
31 lines (23 loc) · 1008 Bytes
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
import java.awt.Color;
public class Colour {
GUI gui;
public Colour(GUI gui){
this.gui = gui;
}
public void changeColour(String col){
switch (col) {
case "White": gui.window.getContentPane().setBackground(Color.white);
gui.textArea.setBackground(Color.white);
gui.textArea.setForeground(Color.black);
break;
case "Black": gui.window.getContentPane().setBackground(Color.black);
gui.textArea.setBackground(Color.black);
gui.textArea.setForeground(Color.white);
break;
case "Blue": gui.window.getContentPane().setBackground(Color.blue);
gui.textArea.setBackground(Color.blue);
gui.textArea.setForeground(Color.white);
break;
}
}
}