2

i was following the David Brackeen's Developing Games in Java book and i made a simple script that allows to enter windowed mode. Well .. the problem is that when i draw the buttons the title bar overlaps them . Is there a way to fix it ?

ScreenShot:

enter image description here See it? The bar overlaps the buttons!

Here is the netbeans project (the main source file is MenuTest): http://www.mediafire.com/?tyc16am8ga517c7

user965675
  • 33
  • 4
  • What is the layout you use? Maybe the widgets don't reposition correctly. – zeller Jan 03 '12 at 09:26
  • nobody knows what did you tried, nor which part of `David Brackeen's Developing Games in Java Book`, edit yu post with a http://sscce.org/ that demonstrated your issues – mKorbel Jan 03 '12 at 09:28
  • :D i dont use any layout :) , i mean i just swiched the deafult fullscreen mode to windowed mode and this happend :/ i thought of expanding the window and then moving the graphics down – user965675 Jan 03 '12 at 09:31

1 Answers1

4

1) use proper LayoutManager instead of setSize / setBounds

2) use paintComponent() for Swing JComponents instead of paint() method

3) use KeyBindinds rather than KeyListener

mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • Thanks :) , i was rather thinking of expnding the window then moving graphics down , but those solutions are also ok . – user965675 Jan 03 '12 at 09:29