I'm developing a mac application in Java that will record video. Although you might say this belongs in the mac forum, all but one of my problems (#4) are for PC and Mac, so since there are more people here, I thought I'd get better answers. If 1 through 3 get answered this should be moved to the mac area.
1. A year ago when I first started using painting in awt, I had problems where the title bar was included in the JFrame size. After what seemed like hours of searching I finally found http://www.acm.org/crossroads/xrds13-3/minueto.html, which saved me. However, I don't want to have a canvas in there because I don't need to paint anything. Plus, the canvas solution won't work because it relies on pack() to work, and I'm going to be resizing all over the place.
My first idea for a solution would be to figure out the offset created by the current look and feel on each side and use that to find the real size of my window, but I have no idea how to do that.
2. When I finally find a recording solution, how the user interface will work is that when you record, the box you have below the title bar will be the area that is going to be recorded. However, I need the title bar offset to calculate where the box below really is.
3. This isn't extremely important, but I'd really like to have a live resize listener; that is instead of the title bar showing the new size once I let go of the mouse, which I have now, it would update the title bar every pixel of change that happens, so it saves users a lot of clicks when they want to make the recording window a certain size.
4. This isn't super important either, but when I hide my window the menu bar disappears. Apparently apple.laf.useScreenMenuBar only makes the menu bar move to the top when the menu bar is visible. I'd like to be able to hide my window and re-open it whenever I want, because eventually I'll figure out how to make it so that it always stays in front, even when it doesn't have focus.
I'm sorry that I need so much help... =(
Joined: Jun 27, 2009
Help! I've found the Container.getInsets() method, but whenever I use it I just get 0 for everything!