pixel « Layout « Java Swing Q&A





1. Swing: How to position JFrame N pixels away from the center of the screen at first setVisible()?    stackoverflow.com

What's the code to position a JFrame N pixels (say 300 pixels in x-direction) away from the center of the screen before one calls setVisible(true)?

2. Java - explain gridbag weight to display pixels relationship/formula/conversion    stackoverflow.com

I've been playing around with GridBagLayout and I can't seem to figure out how many pixels I'm going to get with a particular weighting in the constraints. For example, say I have ...

3. Layout is leaving some pixels on the right    coderanch.com

Hi everybody, I'm having a problem with drawing a "window" inside a JPanel. This "window" will have a header and a body. The problem is that on the header, there is a space of a couple pixels unused so the header doesn't stay aligned with the body. The header is a JPanel with GridLayout, the "window" uses a BorderLayout and the ...