@ -13,9 +13,6 @@ import java.awt.event.ActionListener;
import java.awt.event.ItemEvent ;
import java.awt.event.ItemListener ;
import java.io.File ;
import java.io.FileInputStream ;
import java.io.FileNotFoundException ;
import java.io.IOException ;
import java.util.Arrays ;
import java.util.Comparator ;
import java.util.LinkedList ;
@ -29,7 +26,6 @@ import javax.swing.JButton;
import javax.swing.JComboBox ;
import javax.swing.JFrame ;
import javax.swing.JLabel ;
import javax.swing.JOptionPane ;
import javax.swing.JPanel ;
import javax.swing.JScrollPane ;
import javax.swing.JTextField ;
@ -47,7 +43,6 @@ import com.evolute.utils.images.ImageIconLoader;
import com.evolute.utils.tables.BaseTable ;
import com.evolute.utils.tables.VectorTableModel ;
import com.evolute.utils.ui.CustomJDialog ;
import com.evolute.utils.ui.DialogException ;
public class MailDialog extends CustomJDialog
{
@ -69,48 +64,50 @@ public class MailDialog extends CustomJDialog
protected Action removeAttachmentAction ;
public static void main ( String args [ ] )
throws Exception
{
MailDialog mailDialog = new MailDialog ( null ) ;
mailDialog . setTo ( "fredPalma@netcabo.pt" ) ;
mailDialog . setBcc ( "fpalma@evolute.pt" ) ;
mailDialog . setSubject ( "SIPRP - Marca\u00E7\u00E3o de consulta de 'Frederico Palma'" ) ;
mailDialog . setMessage (
"<p>"
+ "<font size=\"3\" face=\"Arial\">Vimos pelo presente informar que 'Frederico Palma' deverá comparecer "
+ "nas nossas instalações para a realização da consulta de Medicina "
+ "do Trabalho, no dia '<b>10-01-2008</b>', pelas <b>08H30</b>. </font>"
+ "</p>"
+ "<p>"
+ "<font size=\"3\" face=\"Arial\">Solicitamos, também, que o colaborador seja portador do <b>Boletim de Vacinas</b> e "
+ "dos <b>últimos exames complementares</b> realizados.</font>"
+ "</p>"
+ "<p>"
+ "<font size=\"3\" face=\"Arial\">Caso não seja possível a comparência deste colaborador na data "
+ "indicada, contacte-nos, por favor, através do telefone 21 350 45 40 "
+ "ou respondendo ao remetente desta mensagem.</font>"
+ "</p><p></p>"
+ "<p>"
+ "<font size=\"3\" face=\"Arial\">Cumprimentos,</font>"
+ "</p>"
+ "<p>"
+ "<font size=\"3\" face=\"Arial\">SIPRP</font>"
// color=\"#497895\"
+ "</p>"
+ "<p>"
+ "<font size=\"3\" face=\"Arial\">ATRIUM SALDANHA</font>"
+ "</p>"
+ "<p>"
+ "<font size=\"3\" face=\"Arial\">Praça Duque de Saldanha, 1 - 9ºG</font>"
+ "</p>"
+ "<p>"
+ "<font size=\"3\" face=\"Arial\">1050-094 Lisboa"
+ "</p>" ) ;
mailDialog . setSize ( 1024 , 768 ) ;
mailDialog . setVisible ( true ) ;
System . exit ( 0 ) ;
}
private boolean sent = false ;
//
// public static void main( String args[] )
// throws Exception
// {
// MailDialog mailDialog = new MailDialog( null );
// mailDialog.setTo( "fredPalma@netcabo.pt" );
// mailDialog.setBcc( "fpalma@evolute.pt" );
// mailDialog.setSubject( "SIPRP - Marca\u00E7\u00E3o de consulta de 'Frederico Palma'" );
// mailDialog.setMessage(
// "<p>"
// + "<font size=\"3\" face=\"Arial\">Vimos pelo presente informar que 'Frederico Palma' deverá comparecer "
// + "nas nossas instalações para a realização da consulta de Medicina "
// + "do Trabalho, no dia '<b>10-01-2008</b>', pelas <b>08H30</b>. </font>"
// + "</p>"
// + "<p>"
// + "<font size=\"3\" face=\"Arial\">Solicitamos, também, que o colaborador seja portador do <b>Boletim de Vacinas</b> e "
// + "dos <b>últimos exames complementares</b> realizados.</font>"
// + "</p>"
// + "<p>"
// + "<font size=\"3\" face=\"Arial\">Caso não seja possível a comparência deste colaborador na data "
// + "indicada, contacte-nos, por favor, através do telefone 21 350 45 40 "
// + "ou respondendo ao remetente desta mensagem.</font>"
// + "</p><p></p>"
// + "<p>"
// + "<font size=\"3\" face=\"Arial\">Cumprimentos,</font>"
// + "</p>"
// + "<p>"
// + "<font size=\"3\" face=\"Arial\">SIPRP</font>"
//// color=\"#497895\"
// + "</p>"
// + "<p>"
// + "<font size=\"3\" face=\"Arial\">ATRIUM SALDANHA</font>"
// + "</p>"
// + "<p>"
// + "<font size=\"3\" face=\"Arial\">Praça Duque de Saldanha, 1 - 9ºG</font>"
// + "</p>"
// + "<p>"
// + "<font size=\"3\" face=\"Arial\">1050-094 Lisboa"
// + "</p>" );
// mailDialog.setSize( 1024, 768 );
// mailDialog.setVisible( true );
// System.exit( 0 );
// }
public MailDialog ( JFrame owner , String to , String bcc , String subject , String message , Vector < File > files )
throws Exception
@ -128,16 +125,16 @@ public class MailDialog extends CustomJDialog
setVisible ( true ) ;
}
public MailDialog ( JFrame owner )
throws Exception
{
super ( owner , true ) ;
this . owner = owner ;
commonStartup ( ) ;
setModal ( true ) ;
setSize ( 1024 , 768 ) ;
setVisible ( true ) ;
}
// public MailDialog( JFrame owner )
// throws Exception
// {
// super( owner, true );
// this.owner = owner;
// commonStartup();
// setModal( true );
// setSize( 1024, 768 );
// setVisible( true );
// }
private void commonStartup ( )
throws Exception
@ -581,6 +578,7 @@ public class MailDialog extends CustomJDialog
try
{
sender . send ( to , bcc , subject , body , attachmentList , attachments ) ;
sent = true ;
}
catch ( Exception ex )
{
@ -588,6 +586,11 @@ public class MailDialog extends CustomJDialog
}
}
public boolean wasSent ( )
{
return sent ;
}
public void close ( )
{
SwingUtilities . invokeLater ( new Runnable ( ) {