Hello guys, i have a question regarding how to change the origin of a window, particularly a JFrame.

I'm essentially running a program called "Fraps" to see the frames per second of my JFrame, with this program, you can display the fps on any 4 corners of the window currently on focus, however, my problem is that if i choose to display the fps on the top left or right of the window, it overlaps the information tab or whatever (the bar that displays the name of the process and minimize/exit buttons) so the fps display becomes nearly invisible.

There's a cheap way to fix this, I could simply make the JFrame undecorated, but that will make the moving of the window on the monitor impossible, so I don't want to go this route.

I'm thinking that if i can change the origin of the screen to be 0 + the inset of the information bar's width and 0 + the inset of the information's bar height, this problem may be resolved.

Any ideas on this issue? Thank you guys for your time.

Recommended Answers

All 5 Replies

Are you asking about the location of a window on the monitor? There are methods for setting the location.

no, i want to change the 0,0 origin inside a particular JFrame.

Please explain what you are trying to do. What component is inside the JFrame that you are trying to change the position of?

Click Here

Click Here

these 2 images should explain it better than I can, basically, i want the second picture's fps display to look like the first one, but below the information bar.

in the first picture, the window is undecorated, which is why there's no problem there.

Is the "fps display" a component like a JPanel that you want to change the location of in a container like a frame?
Can you make a small simple program that compiles and executes and shows the problem?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.