943,699 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 7859
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Feb 5th, 2009
0

Help!!!! User Login page with java

Expand Post »
I want to create User Login page, but i have no idea about this, any idea for me? because just start to learn java, but i need create Login page....
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
snail_snail21 is offline Offline
7 posts
since Feb 2009
Feb 5th, 2009
0

Re: Help!!!! User Login page with java

Using a desktop application or a web application??
Reputation Points: 9
Solved Threads: 2
Newbie Poster
danielernesto is offline Offline
16 posts
since Nov 2007
Feb 6th, 2009
0

Re: Help!!!! User Login page with java

I just wan create for a system login, just for admin to login the system.no need web application.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
snail_snail21 is offline Offline
7 posts
since Feb 2009
Feb 6th, 2009
0

Re: Help!!!! User Login page with java

have you worked with Swing before?

create a DBConnection (since I think you'll want your passwords and usernames to be stored in a DB) and write a frame with contains two input fields.

what have you got this far?
Reputation Points: 919
Solved Threads: 354
Nearly a Posting Maven
stultuske is offline Offline
2,487 posts
since Jan 2007
Feb 6th, 2009
0

Re: Help!!!! User Login page with java

Check out this tutorial on swing in case you want to get your GUI up and running and then you might want do some validations on the username and password either in the database (then you might want to look here for jdbc) or want to use Files instead.
Last edited by stephen84s; Feb 6th, 2009 at 5:10 am.
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007
Feb 6th, 2009
0

Re: Help!!!! User Login page with java

i just design the login interface. The problem i face is i don't know how to continue after design.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
snail_snail21 is offline Offline
7 posts
since Feb 2009
Feb 6th, 2009
0

Re: Help!!!! User Login page with java

Now the next logical step would be you want to validate the user.
What you could do is store a username and a password in either a File or a table in a database for ex: MS Access (or Apache Derby which ships with the JDK I assume.)

And whenever anyone clicks on say the "Login" or "Submit" button you would have to first validate whether the user has actually entered a value in the Password and UserName fields (if not you could show him an error message using the dialog boxes of JOptionPane) but if a proper value is found in both the fields you validate the user against the values (for username and password) present in the File or the database.
If the username and password combination specified in the form fields matches what you have in the File (or a the database table), you could display a success message (using JOptionPane once again) and stop there itself or take him a new form where you might want to do some more processing.
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007
Feb 7th, 2009
0

Re: Help!!!! User Login page with java

ok, i will try it. Thanks for giving advise.....actually i need to implement a motor plate recognition system by using java language.Anyone have any idea? I just got 2 more months to develop this system.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
snail_snail21 is offline Offline
7 posts
since Feb 2009
Feb 9th, 2009
0

Re: Help!!!! User Login page with java

how to load an image into the frame? Because i'm implementing a MOTOR PLATE RECOGNITION SYSTEM.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
snail_snail21 is offline Offline
7 posts
since Feb 2009
Feb 9th, 2009
0

Re: Help!!!! User Login page with java

public class FrameMain extends javax.swing.JFrame {
private CarSnapshot car;

public class RecognizeThread extends Thread {
FrameMain pFrame = null;

public RecognizeThread(FrameMain pFrame) {
this.pFrame = pFrame;
}
public void run() {
String recognizedText = "";
this.pFrame.recognitionLabel.setText("processing ...");
int index = this.pFrame.chooseIndex;
try {
/// recognizedText = Main.systemLogic.recognize(this.pFrame.car);
} catch (Exception ex) {
this.pFrame.recognitionLabel.setText("");
return;
}
this.pFrame.recognitionLabel.setText(recognizedText);
this.pFrame.fileListModel.fileList.elementAt(index).plateRecognition = recognizedText;
}
}
public class LoadImageThread extends Thread {
FrameMain pFrame = null;
String url = null;
public LoadImageThread(FrameMain pFrame, String url) {
this.pFrame = pFrame;
this.url = url;
}
public void run() {
try {
this.pFrame.car = new CarSnapshot(url);
this.pFrame.panelCarContent = this.pFrame.car.duplicate().getBi();
this.pFrame.panelCarContent = Photo.linearResizeBi(this.pFrame.panelCarContent,
this.pFrame.panelCar.getWidth(),
this.pFrame.panelCar.getHeight());
this.pFrame.panelCar.paint(this.pFrame.panelCar.getGraphics());
} catch (IOException ex) {
ex.printStackTrace();
}
}
}

///CarSnapshot car;

BufferedImage panelCarContent;
JFileChooser fileChooser;
private FileListModel fileListModel;
int chooseIndex = -1;
/** Creates new form FrameMain */
public FrameMain() {
initComponents();
// init : file chooser
this.fileChooser = new JFileChooser();
this.fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
/////this.fileChooser.setFileFilter(new ImageFileFilter());


// init : window dimensions and visibility
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int width = this.getWidth();
int height = this.getHeight();
this.setLocation((screenSize.width - width)/2,(screenSize.height - height)/2);
this.setVisible(true);
}
private void fileListValueChanged(javax.swing.event.ListSelectionEvent evt) {
int selectedNow = this.fileList.getSelectedIndex();

if (selectedNow != -1 && this.chooseIndex != selectedNow) {
this.recognitionLabel.setText(this.fileListModel.fileList.elementAt(selectedNow).plateRecognition);
this.chooseIndex = selectedNow;
// proceed selectedNow
String path = ((FileListModel.FileListModelEntry)this.fileListModel.getElementAt(selectedNow)).fullPath;
//this.showImage(path);
/// new LoadImageThread(this,path).start();
}
}

private void recognizeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
/// String plate = null;

// namiesto tohto urobime thread plate = Main.systemLogic.recognize(this.car);
// thread code start
/// new RecognizeThread(this).start();
}

private void loadImageActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int returnValue;
String fileURL;

this.fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
this.fileChooser.setDialogTitle("Load Image");
returnValue = this.fileChooser.showOpenDialog((Component)evt.getSource());

if (returnValue != this.fileChooser.APPROVE_OPTION) return;

fileURL = this.fileChooser.getSelectedFile().getAbsolutePath();
File selectedFile = new File(fileURL);

this.fileListModel = new FileListModel();
for (String nameOfFile : selectedFile.list()) {
///// if (!ImageFileFilter.accept(nameOfFile)) continue; // not a image
this.fileListModel.addFileListModelEntry(nameOfFile, selectedFile+File.separator+nameOfFile);
}
this.fileList.setModel(fileListModel);
}

private void exitMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
System.exit(0);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FrameMain().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JMenu exit;
private javax.swing.JMenu file;
private javax.swing.JList fileList;
private javax.swing.JScrollPane fileListScrollPane;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem loadImage;
private javax.swing.JPanel panelCar;
private javax.swing.JLabel recognitionLabel;
private javax.swing.JButton recognize;
// End of variables declaration

}
Reputation Points: 10
Solved Threads: 0
Newbie Poster
snail_snail21 is offline Offline
7 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: HELP!!
Next Thread in Java Forum Timeline: jAVa_assistance





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC