Jump to content
We've recently updated our Privacy Statement, available here ×

Make iReport DISPOSE_ON_CLOSE


2006 IR Open Discussion

Recommended Posts

By: Percibal - percibalinux

Make iReport DISPOSE_ON_CLOSE

2006-03-27 07:18

How 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:17

hi,

 

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:28

Hi, 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:43

there 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:32

Frame 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:15

Thanks 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:28

final 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:14

WindowListener[] 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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...