0

I have stepped in working with Java 2D and initially i have been stucked how to shift my drawing location after Title Bar. If i start drawing x,y (0,0). my Shapes are that is under Title bar hides.

Wha tis the best way to set the Drawing Location after Title Bar.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Bibi Tahira
  • 1,082
  • 5
  • 15
  • 39

1 Answers1

1

It sounds like you've overridden paint on a top level container, like JFrame? This is your problem. A JFrame's decoration is actually painted inside the window.

You should create a custom component, say from JPanel for example, override it's paintComponent method and perform your custom painting there.

You can then add this to your frame or replace the frames content pane.

Take a closer look at Performing Custom Painting

You can to a look at

For more examples...

Community
  • 1
  • 1
MadProgrammer
  • 343,457
  • 22
  • 230
  • 366