on 02-11-2010 9:25 AM
When running ReportViewerBean from a JDialog, the Export dialog and other popups locate top-left on the screen instead of being centered over the Panel. The code listing below illustrates a standalone JDialog but the requirement is for the JDialog (which contains the RVB) to be owned by a JFrame.
When a JFrame is used to contain the RVB instead of the dialog, it works as expected - all popup dialogs center.
ReportViewerBean b = new ReportViewerBean();
// ... bean config code
JDialog d = new JDialog();
//JFrame f = new JFrame(); // works
d.setTitle("JRC Test");
d.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
d.add(b, BorderLayout.CENTER);
d.setSize(new Dimension(800, 500));
d.setLocationRelativeTo(null);
b.init();
b.start();
d.setVisible(true);
ReportViewerBean looks for a parent instance of java.awt.Frame to do positioning.
Sincerely,
Ted Ueda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.