-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathFunction_Color.java
More file actions
31 lines (26 loc) · 886 Bytes
/
Function_Color.java
File metadata and controls
31 lines (26 loc) · 886 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.*;
public class Function_Color {
GUI gui;
Function_Color(GUI gui){
this.gui=gui;
}
public void changeColor(String color){
switch (color){
case "White":
gui.window.getContentPane().setBackground(Color.WHITE);
gui.textArea.setBackground(Color.WHITE);
gui.textArea.setForeground(Color.BLACK);
break;
case "Black":
gui.window.setBackground(Color.BLACK);
gui.textArea.setBackground(Color.BLACK);
gui.textArea.setForeground(Color.white);
break;
case "Red":
gui.window.setBackground(Color.red);
gui.textArea.setBackground(Color.red);
gui.textArea.setForeground(Color.WHITE);
break;
}
}
}