Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent e)
if (e.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) {
File f = fc.getSelectedFile();
if (f != null) {
theView.setText("");
OutputStream out = theView.getOutputStream();
try {
FileInputStream in = new FileInputStream(f);
FileDumper5.dump(in, out, mp.getMode(), mp.isBigEndian(),
mp.isDeflated(), mp.isGZipped(), mp.getPassword());
}
catch (IOException ex) {
}
}
}
else if (e.getActionCommand().equals(JFileChooser.CANCEL_SELECTION)) {
this.closeAndQuit();
}
|
private void | closeAndQuit()
this.setVisible(false);
this.dispose();
//
System.exit(0);
|
public void | init()
this.addWindowListener(this);
fc.setApproveButtonText("View File");
fc.setApproveButtonMnemonic('V");
fc.addActionListener(this);
this.getContentPane().add("Center", fc);
JScrollPane sp = new JScrollPane(theView);
this.getContentPane().add("South", sp);
this.getContentPane().add("West", mp);
this.pack();
// center on display
Dimension display = getToolkit().getScreenSize();
Dimension bounds = this.getSize();
int x = (display.width - bounds.width)/2;
int y = (display.height - bounds.height)/2;
if (x < 0) x = 10;
if (y < 0) y = 15;
this.setLocation(x, y);
|
public static void | main(java.lang.String[] args)
FileViewer fv = new FileViewer();
fv.init();
fv.show();
|
public void | windowActivated(java.awt.event.WindowEvent e)
|
public void | windowClosed(java.awt.event.WindowEvent e)
|
public void | windowClosing(java.awt.event.WindowEvent e)
this.closeAndQuit();
|
public void | windowDeactivated(java.awt.event.WindowEvent e)
|
public void | windowDeiconified(java.awt.event.WindowEvent e)
|
public void | windowIconified(java.awt.event.WindowEvent e)
|
public void | windowOpened(java.awt.event.WindowEvent e)
|