2006 IR Open Discussion Posted September 2, 2006 Share Posted September 2, 2006 By: Percibal - percibalinux Make iReport DISPOSE_ON_CLOSE 2006-03-27 07:18How can I make the iReport Window to close but not end the program in a Java Application? By: venkat - venkat1201 RE: Make iReport DISPOSE_ON_CLOSE 2006-03-27 20:17hi, Just open the iReport viewer to be open in a new window that mean new Frame i think this may solve u'r problem regards venkat By: Percibal - percibalinux RE: Make iReport DISPOSE_ON_CLOSE 2006-03-28 04:28Hi, thanks for your reply. I'm trying different ways to do this, for example: JasperViewer viewer = new JasperViewer(jasperPrint, true); viewer.setDefaultCloseOperation(viewer.HIDE_ON_CLOSE); viewer.setVisible(true); But it still ending the program when I close the iReport Window. What do you think? regars Percibal. By: venkat - venkat1201 RE: Make iReport DISPOSE_ON_CLOSE 2006-03-28 04:43there u r making a small mistake just add the viewer to the new frame ok. if u want help in coding ask me i will send u all the code how to do it its too simple regards venkat By: venkat - venkat1201 CODE FOR JASPERVIEWER CLOSING 2006-03-28 21:32Frame frame = new Frame(); frame.setSize(700,700); frame.add(viewer); //viewer is the object of jasperviewer //JasperViewer viewer = new JasperViewer(jasperPrint, true); and add windows listner to close this frame By: Percibal - percibalinux RE: Make iReport DISPOSE_ON_CLOSE 2006-03-30 05:15Thanks very much, now it is working, also I have to use AddContainer becouse this code return and "adding Window to a container" error. Again, thank for your help!!! regards Percibal. By: venkat - venkat1201 U can DO it like this also 2006-03-30 23:28final javax.swing.JDialog viewerwindow = new javax.swing.JDialog(new JFrame(), "Report Viewer ", true); viewerwindow .getContentPane().add(Jasperviwerobject); viewerwindow .setBounds(new Rectangle(500, 300)); viewerwindow .addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent winevt) { viewerwindow .dispose(); } }); viewerwindow .setVisible(true); By: goodpp - goodpp RE: Make iReport DISPOSE_ON_CLOSE 2006-04-07 18:14WindowListener[] wl = jView.getWindowListeners(); for(int i=0; i<wl.length; i++) { jView.removeWindowListener(wl); } jView.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); jView.setVisible(true); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now