Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JButton issue for a JFrame

843806Apr 13 2009 — edited Apr 15 2009
Hi All,

I have a JButton on the JPanel.So when i click on the button i get one frame which contains many setting parameters required for my application.But the problem when i click on the same 20 times i get 20 windows of my settings in the same case till n times.So i have used boolean flag variable and cleared the problem.

Now my question i am doing the same mechanism with one more JButton like this
JButton mailToItem=new JButton("DROPMAIL");
 mailToItem.addActionListener(new OnDropAMail());

class OnDropAMail implements ActionListener{
	
public void actionPerformed(ActionEvent mailEvent) {
        try {
			if ( mailEvent.getSource()==mailToItem ){
	  	JTextField maillabel=new JTextField("mailTo:queryforall@gmail.com");	
		maillabel.setEditable(false);
          URI mailURI = new URI(maillabel.getText());
		  
		  desktop.mail(mailURI);
		  
		 // checkdropmail=false;
		 // QueryMailing.main(call);
            }        } catch (Exception ex) {
          System.out.println(ex.getMessage());
        }
                   }
}
So in the above code problem is when i click on the same DROPMAIL button continuously i am getting many outlook express windows since my default email client in my local machine is Outlook.So how should i control that Outlook JFrame so that after me closing the JFrame it has to be activated for opening it next time.Some kind of validation has to be authenticated.

Any help Appreciated.

Thanks in advance.

regards,
Viswanadh

Edited by: TechnicalGuy7 on Apr 13, 2009 2:00 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 13 2009
Added on Apr 13 2009
22 comments
273 views