To all the GUI Masters,
I have two questions,
1) How do I make my frame start/appear in the middle of the screen ?
2) How do I disable the control/menu box i.e the maximize,minimize,close options on the top left corner of the frame ?
Wating for a favorable Reply.
Regards.
Max
Max_05
0
Newbie Poster
Recommended Answers
Jump to PostCentering the window:
// Center the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = frame.getSize(); if (frameSize.height > screenSize.height) { frameSize.height = screenSize.height; } if (frameSize.width > screenSize.width) { frameSize.width = screenSize.width; } frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); frame.setVisible(true);
All 4 Replies
jwenting
1,889
duckman
Team Colleague
server_crash
64
Postaholic
jwenting
1,889
duckman
Team Colleague
server_crash
64
Postaholic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.