So I've been programming in java for a semester or so, and I've had this problem a few times and finally got around to asking.
If I make a JFrame
and then set the size, like setSize(400,800)
for example. The frame is not actually 800 pixels
long. From what I can tell it is actually more like 770 (or maybe 769) pixels
long. Also, if you set the vertical size very low (below 30), the frame doesn't even show up, only the top window bar from the OS and the frame doesn't get bigger until you go to a value over 30 (so setSize(400,0)
looks the same as setSize(400,20)
). Why is this, it's not hard to fix but its weird and I'm curious why this is?
If you need more information about anything just ask and I'll get it to you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…