Fri Apr 10, 2009 12:37 pm
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
//// Action submit button for main form submit//
String user_name=jTextField1.getText();
String pasword=jPasswordField1.getText();
if(user_name==" " || pasword==" ")
{
JOptionPane.showMessageDialog(null,"Invalid User Name or Password","Error",JOptionPane.ERROR_MESSAGE);
}
if you want file upload as like text file.you can see this code for file chooser
private JFileChooser fileChooser;
try
{
fileChooser = new JFileChooser();
int result= fileChooser.showOpenDialog(this);
if(result==JFileChooser.CANCEL_OPTION)
{
JOptionPane.showMessageDialog(null,"You Cancel it.","Warning",JOptionPane.ERROR_MESSAGE);
}
else
{
your work
}
catch(FileNotFoundException exception)
{
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.