The background is transparent so the board shows through. When I try to use clearRect the screen gets set to the background color (grey) and hides the board.
I've tried setting the background color to a transparent alpha but that doesn't work.
Essentially, I need to be able to make a specified rectangle clear and be transparent so I can redraw the countdown.
If there is another way, that would be great too.
1 2 3 4 5 6 7 8 9
| void drawBigText(String text) { Graphics2D g = (Graphics2D) getGlassPane().getGraphics(); AttributedString styledText = new AttributedString(text); styledText.addAttribute(TextAttribute.FAMILY, "serif"); styledText.addAttribute(TextAttribute.SIZE, new Float(120)); styledText.addAttribute(TextAttribute.FOREGROUND, Color.yellow); AttributedCharacterIterator i = styledText.getIterator(); g.drawString(i, 80, 250); } |