This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
|
swing:color [2016/05/25 08:23] gthanos |
swing:color [2018/03/27 22:19] gthanos |
||
|---|---|---|---|
| Line 8: | Line 8: | ||
| Για παράδειγμα, | Για παράδειγμα, | ||
| <code java> | <code java> | ||
| + | // assuming you are inside the constructor or a non static method of the frame | ||
| this.getContnetPane().setBackground(Color.BLUE); | this.getContnetPane().setBackground(Color.BLUE); | ||
| </ | </ | ||
| Line 75: | Line 76: | ||
| | | ||
| public ColorDemo() { | public ColorDemo() { | ||
| - | super(" | + | super(" |
| setSize(WIDTH, | setSize(WIDTH, | ||
| setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
| Line 139: | Line 140: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | | Προηγούμενο: | ||