I was working on an applet, and this worked fine... now I've converted it into a Frame, and it's not working quite so well. Here's my main():<br><br><FONT FACE=monospace>MyClass f = new MyClass();<br>f.setSize(270, 314);<br>f.setVisible(true);<br>f.setBackground(Color.blue);<br>Graphics g = f.getGraphics();<br>g.setColor(Color.lightGray);<br>g.fillRect(0, 0, (BoardSize.rectLeft + BoardSize.rectRight), BoardSize.scoreHeight);<br>g.setColor(Color.black);<br>g.fillRect(BoardSize.rectLeft, BoardSize.rectTop, BoardSize.rectRight - BoardSize.rectLeft, BoardSize.rectBottom - BoardSize.rectTop);</font><br><br>Here's the problem. As you can see, basically what I do here is set the size, set visible, set background, and then construct g from f.getGraphics() seeing as how I don't have a Graphics object without my paint() from my applet. Then I change the color and draw a rectangle, then change the color and draw another rectangle (I have a static class that has my window size, just so it's easy to change if I need to).<br><br>The problem is... when I invoke g.setColor(), nothing happens. When I output to the screen, everything is blue. <i>What am I missing?</i><br><br>I know it's not a problem with BoardSize, because I tried filling a rectangle with actual coordinates: g.fillRect(1, 1, 11, 10). That was just a test to see if it would show up... it didn't. I'm guessing I'm missing something rather simple... I tried commenting out the setBackground() to see if the rectangles were showing up behind, but they weren't... so my clue is, f.getGraphics() is not the proper way to construct a graphics object. How do I draw to the screen with a frame?<br><br><br>Thanks all.. I'm just getting back into graphics (never got that involved in the first place, but I'm going to have to learn Swing fast), and I'm really feeling like a newbie all over again. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence."
light the world, and bring depth to the silence."