I'm trying to 'embed' an existing Java app into my own application.
The existing app is a JFrame
with a number of components added to it. I copied the code into my project and replaced the JFrame
with a new JPanel
that I then added to my own app.
The problem is everything painted in the JPanel
appears to be shifted up by a small amount (e.g. ~20px). I wondered if it's anything to do with window menubars etc but so far haven't been able to find a solution apart from manually adding an offset when painting (definitely not ideal!).
I know without the code it can be difficult to offer helpful suggestions, but what I want to know is, do the JFrame
and JPanel
behave differently in a way that would cause this? Or is there anything else obvious to fix it?