John Topley's Knowledgebase

Centring A JDialog On The Screen

Tuesday, 05 August 2003

This Java code centres a Swing JDialog on the screen.

JDialog dialog = new JDialog();

// Centres the dialogue if null is specified as the component.
dialog.setLocationRelativeTo(null);

top | index | no previous | next | comments ()

home | archive | kb | media | about | contact | accessibility
Copyright © 2003 - 2005 John Topley. Made with CityDesk.