₦airaland Forum

Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,023,965 members, 4,315,887 topics. Date: Sunday, 24 June 2018 at 04:11 PM

Java_desktop_application - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Java_desktop_application (1962 Views)

(1) (2) (3) (4)

(0) (Reply) (Go Down)

Java_desktop_application by arokans(m): 12:59am On Dec 24, 2012
I am working on a project (desktop-based application) on building a platform where students and lecturers can interact concerning the school projects being carried out by the students. I have just read a good part of Java SE and want to implement skills through tactile means. I have done a bit in designing interfaces, abstraction and modelling as well as creating classes to accommodate the Student, Staff , these two extending a generic User class. I am presently reading databases in order to be able to store information about the student, staff as well as the projects. I need people with experience in this aspect to help so that i can move faster and complete this project within the timeline I have. Thanks in advance.
Re: Java_desktop_application by xterra2(m): 6:43pm On Dec 24, 2012
Next time, Ask the particular area you need help with.
& please keep this thread updates, i sort of like this idea

What area do you need help exactly?
Re: Java_desktop_application by naijaswag1: 8:51am On Dec 25, 2012
You want to create a chat engine, you gonna deal with networking a bit, I did one that has a blackboard for someone's project.
Re: Java_desktop_application by stanliwise(m): 11:52am On Dec 26, 2012
you need to learn how to use java to interact with mysql.
to be able to gather information pls try search foe dat
Re: Java_desktop_application by danvery2k6(m): 11:18pm On Dec 26, 2012
If you need immeadiate knowledge of MySQL, you can use the help documentation that comes with MySQL. 24 hrs should get you started
Re: Java_desktop_application by arokans(m): 2:45pm On Dec 27, 2012
Thanks guys. I am getting a lot of help watching youtube videos. Thank you for your positive response. I will keep you posted on my progress.
Re: Java_desktop_application by LordRahl001: 10:53pm On Dec 30, 2012
Instead of mysql, u can use access as ur database without worrying your client with database installations. For a project like ds, access won't b a bad idea
Re: Java_desktop_application by arokans(m): 3:47pm On Jan 08, 2013
Re: Java_desktop_application by arokans(m): 3:51pm On Jan 08, 2013
Re: Java_desktop_application by xterra2(m): 6:24pm On Jan 08, 2013
Are you using Netbeans ? if yes, then try to upload a screenshot here please to see what you have done so far that way i can give suggestions
Re: Java_desktop_application by arokans(m): 10:26am On Jan 10, 2013

Re: Java_desktop_application by xterra2(m): 11:08pm On Jan 10, 2013
Nice, was thinking of the same project a few months back but i got occupied by many projects of mine
Anyway, as of this moment apart from the login screen what other screen do you have ?
You posted a non working code of your login- here is a snipet from my own login in my projects i did a year ago

String sql="Select * from login";
try {
Connection con= (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mine","root","root"wink;
Statement stmt=con.createStatement();
ResultSet rs = stmt.executeQuery(sql);

String user=jTextField1.getText();
String pwd= new String (jPasswordField1.getPassword());
while(rs.next()) {
String uname=rs.getString("username"wink;

String password=rs.getString("password"wink;
if ((user.equals(uname)) && (pwd.equals(password))) {
new admin().setVisible(true);

else {
JOptionPane.showMessageDialog(this, "incorrect username or password"wink;
catch (Exception e){
JOptionPane.showMessageDialog(this, e.getMessage());
Re: Java_desktop_application by lordZOUGA(m): 11:21pm On Jan 10, 2013
ermmm.. Why not use git?? (Am assuming by projects you mean software projects though it can manage any thing that is text based) Its opensource and it has been tested. If you don't like the command line or if you want to add features that are particular to students, provide a wrapper application then run git as a seperate process and communicate with it using any IPC method you prefer.
Re: Java_desktop_application by LordRahl001: 12:46am On Jan 15, 2013

Guys, I have been able to design User interfaces and the issue with the db is solved now and I still ended up using mysql. Thank you for your invaluable contributions. Really, the issue now is getting to login. I have written methods to handle that which is successfully built but fails to log in valid user. Below are code excerpts to explain my challenges. Meaningful contributions would be appreciated.

public String extractUserIDFromTextField ( JTextField textField){
return textField.getText();

public String extractPasswordFromPasswordField (JPasswordField passwordField){
return passwordField.getText();


public boolean validateStudentUserID (JTextField textField ) throws Exception{
return extractUserIDFromTextField(textField).matches ("[a-z]{3}/[0-9]{4}/[a-z]{3}"wink;

public boolean studentValidityMethod (JTextField textField, JPasswordField passwordField) {

String submittedUserID = extractUserIDFromTextField(textField);
String submittedPassword = extractPasswordFromPasswordField(passwordField);

connection = DriverManager.getConnection ("jdbc:mysql://localhost:3306/spma", "root", null);
statement = connection.createStatement();
resultSet =statement.executeQuery("SELECT matriculationNumber, password FROM studentuser WHERE matriculationNumber = submittedUserID ORDER BY matriculationNumber, password"wink;

String correctUserID = resultSet.getString(1);
String correctPassword = resultSet.getString(2);

if ((submittedUserID.equals(correctUserID)) & (submittedPassword.equals(correctPassword)))

studentValidity = true;
studentValidity = false;
catch(SQLException e){

finally {
return studentValidity;

THE METHODS ARE OF StudentUser which extends the previous class User
Then in the login JFrame, under the event handler method i wrote this:
private void logInButtonFieldActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
/** method to grant access to the HomePage is granted if grantAccessToStudentOrNot method returns true or
* if otherwise, access is declined with a response message

if (su.validateStudentUserID(userIDTextField) == true)
if (su.studentValidityMethod(userIDTextField, passwordPasswordField) == true)
JOptionPane.showMessageDialog(null, "You are not a student", "Error", JOptionPane.ERROR_MESSAGE);

After this I run my application and there is no error but the next page HomePage is not displayed.
Suggestions are duly welcomed. Lots of appreciation to you guys.

Try adding Class.forName("mysqldriver"wink; d mysql deriver shud b smth lyk com.mysql something. Am not actually sure but u did not refer to any database driver here. The only place you can do dis is in javaDB(derby) it sort of broadcast itself like JINI
Re: Java_desktop_application by Urine: 9:52pm On Jan 27, 2013
@Op, have you populated your database? Please post a screen shot of your computer screen, that will make it easier.
Re: Java_desktop_application by javadoctor(m): 7:29am On Jan 28, 2013
The persistence technology you are using is Obsolete.Please go and readUp about Java Persistence API.So you dnt have to go through the pain of logging into the database with the DriverManager class,in Jpa ,the persistence.xml has the persistence unit configured with the entity classes.What ide are you using to develop? JPA has simplified database applications by persisting entity Objects
Re: Java_desktop_application by arokans(m): 9:02am On Jan 28, 2013
javadoctor, im using netbeans. I have heard stuffs about that JPA but ve nt really done anything on it. Please, can we chat?
Re: Java_desktop_application by arokans(m): 9:10am On Jan 28, 2013
Re: Java_desktop_application by javadoctor(m): 8:12am On Jan 29, 2013
No p,check for my  pin or phone number on my profile

(0) (Reply)

Where To Start Teaching A Child How To Code / Free Source Code Of Web Sms / Web Programming: Where Do I Start?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (0) (1) (2) (3) (4) (5) (6) (7) (8) (9)

Nairaland - Copyright © 2005 - 2018 Oluwaseun Osewa. All rights reserved. See How To Advertise. 65
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.