If I set the size of a GLCanvas and then add it to a JFrame, it’s always a little larger then I want it to be. For example if I set it to be 800x600, it’s 802x602. I don’t use any LayoutManager. Just set the size of the canvas and call JFrame.pack(). How can I get a GLCanvas inside a JFrame that’s exactly 800x600?
public void setInnerSize(int w, int h) {
Insets ins = frame.getInsets();
frame.setSize(w + ins.left + ins.right, h + ins.top + ins.bottom);
}