I was looking at a tut on starting your client in the middle of your screen, well someone said make it for jframe, and I was bored and waiting for people to reply on my game frame help.
Sorry if this has been posted, I'm just bored, and if people want.
anyways here
import this.
Code:
import java.awt.Toolkit;
declare these in your GUI class.
Code:
private static Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
private static int intClientWidth = 765;
private static int intClientHeight = 529;
change int and width if necessary.
add this under your frame packing method.
Code:
mainFrame.setBounds(screenSize.width / 2 - (intClientWidth + 8) / 2, screenSize.height / 2 - (intClientHeight + 28) / 2, intClientWidth + 8, intClientHeight + 28);
remember to change mainFrame to your frame name.
No flame, it's just a snippet on something I figured out while I was bored.