Place JComponent in center of JDialog
- From: "Martijn Mulder" <i@m>
- Date: Wed, 29 Jun 2005 09:47:02 +0200
I have a JComponent that displays an image. I set the getPreferredSize() method
to the dimensions of the image, so when I add it to the content pane of a
JDialog, it fits exactly. When I resize the JDialog, I want the image to be
displayed in the exact center of the content pane. Setting the LayoutManager to
FlowLayout.CENTER doesn't work, the position is not vertically adjusted.
BorderLayout("Center") leaves the image in the top left corner. Howto?
.
- Follow-Ups:
- Re: Place JComponent in center of JDialog
- From: rhino2005
- Re: Place JComponent in center of JDialog
- From: Knute Johnson
- Re: Place JComponent in center of JDialog
- Prev by Date: Re: ProgressMonitor takes too long to display in Sun's ProgressMonitorDemo
- Next by Date: Re: FileDialog.setFilenameFilter()
- Previous by thread: Need help with a viewToModel() problem in a JTable
- Next by thread: Re: Place JComponent in center of JDialog
- Index(es):