Home Answers Viewqa Java-Beginners Create Project SplashScreen

 
 


sushant
Create Project SplashScreen
1 Answer(s)      3 years and 3 months ago
Posted in : Java Beginners

I want to Create project splashscreen that visible only for 1 minute after 1 minute i want to display LogIn form how i can create in java.
View Answers

February 23, 2010 at 12:58 PM


Hi Friend,

Try the following code:

1)SplashScreen.java
import javax.swing.*;

public class SplashScreen extends JFrame{
public static void main(String[] arg) {
JWindow window = new JWindow();
window.getContentPane().add(new JLabel("Loading Login Page...",SwingConstants.CENTER));
window.setBounds(200, 200, 200, 100);
window.setVisible(true);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
window.setVisible(false);
LoginDemo form=new LoginDemo();
form.setVisible(true);
form.setSize(300,100);
window.dispose();
}
}

2)LoginDemo.java:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
class LoginDemo extends JFrame{
JButton SUBMIT;
JPanel panel;
JLabel label1,label2;
final JTextField text1;
final JPasswordField text2;
LoginDemo(){
label1 = new JLabel();
label1.setText("UserName:");
text1 = new JTextField(15);
label2 = new JLabel();
label2.setText("Password:");
text2 = new JPasswordField(15);
SUBMIT=new JButton("Login");
panel=new JPanel(new GridLayout(4,2));
panel.add(label1);
panel.add(text1);
panel.add(label2);
panel.add(text2);
panel.add(SUBMIT);
add(panel,BorderLayout.CENTER);
SUBMIT.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
String value1=text1.getText();
String value2=text2.getText();
String user1="";
String pass1="";
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test";, "root", "root");
Statement st = con.createStatement();
ResultSet res = st.executeQuery("SELECT * FROM login where username='"+value1+"' && password='"+value2+"'");
while (res.next()) {
user1 = res.getString("username");
pass1 = res.getString("password");
}
if (value1.equals(user1) && value2.equals(pass1)) {
JOptionPane.showMessageDialog(null,"Welcome");

}
else{
JOptionPane.showMessageDialog(null,"Incorrect login or password","Error",JOptionPane.ERROR_MESSAGE);
}
}
catch(Exception e){
System.out.println(e.getMessage());
}
}
});
}
public static void main(String arg[]) {
LoginDemo frame=new LoginDemo();
frame.pack();
frame.setVisible(true);
}
}

Thanks









Related Pages:
Create Project SplashScreen - Java Beginners
Create Project SplashScreen   I want to Create project splashscreen... can create in java.   Hi Friend, Try the following code: 1)SplashScreen.java import javax.swing.*; public class SplashScreen extends
project...
project...   enter 10 integers, store it using array then display... them from lowest to highest number to words conversion create a java program... graphics applet create their own favorite cartoon character
project
project   Create appropriate packages and super classes etc. to make your program more efficient and your code more manageable. Create a method to print the Pay slip in an appropriate format. The Pay slip should include
project
project  Create a class diagram, both, for permanent and contracted employees, the details of which are supposed to be accepted and displayed on screen The following details need to be tracked for permanent employees: Employee
create a login project - Development process
create a login project  How to make an application(project)OF LOGIN APPLICATION USING MYSQL DATA BASE TO REGISTER AND LOGIN IN JSF FRAMEORK.  Hi friend, For solving the problem visit to : http://roseindia.net/jsf
Create project from Maven Template
In this section, you will learn to create a simple Java web application project from Maven Template
EJB Project
EJB Project  How to create Enterprise Application project with EJB module in Eclipse Galileo?   Please visit the following link: http://www.roseindia.net/ejb/ejbtutorial/buildingasimpleejbapplication.shtml
need project
. but i need a project on banking system in java with sql database. which should contain following attributes create new account for new customer retrieve... is good plz add it i need project till Saturday i.e 10th march 2012 plzzzz
Project Guidance
Project Guidance  Hello, I have a project in SE at college and me and my group have to develop a web app which will allow them to recruit students.../CSS/XML, SQL, AJAX and Flash In my opinion the best approach is to create
How to create and execute Hibernate project with out Myeclipse ide ?
How to create and execute Hibernate project with out Myeclipse ide ?  Hi, I am new to Hibernate programming please provide me rough design for creating and executing Hibernate project. Thank you
Bank project
Bank project   Create a class Customer a. Having Instance variables.... Method which displays the Customer details Create a Class Account a. Having.... Method which displays the Account details Create a Class BankDemo a. Create three
Network Project
would create folders for each student on the server and also how i would verify
Struts project in RAD
Struts project in RAD  How to create a struts project in RAD
What is a Project?
, months or years. Basically, a project is started in order to create or bring... a project as a temporary endeavour undertaken to create a unique product, service...Before understanding 'Project Management' in detail, the first thing one
project - JDBC
following database table: CREATE TABLE `employee
problem in WSMO project in eclips
not create a WSMO project yet. I mean i don't have the option of WSMO project in file--> new-->project-->...problem in WSMO project in eclips  HI, I am a beginner in WSMO
Project - JSP-Servlet
Project  Can you send me the whole project on jsp or servlet so that i can refer it to create my own : the topic is Advertisement Management System Atleast tell me how many modules does it include
Android Application Project
Android Application Project  Hi, How to create Android Application Project with following features: Select list of music station Play the the selected station Save station in the list Search stations of interest based
Struts Project Planning - Struts
Struts Project Planning  Hi all, I am creating a struts application... classes and which they i should create?? My application wil be using database so should i create those classes which are as table in database?? and how i do all
application development project
create a java program that will let user enter an integer (0-999), then display... and switch 4.drawing graphics applet create their own favorite cartoon character -plz answer my question..i hope that u can help us in our project..thank you:D
j2me project - Java Beginners
j2me project  HOW TO CREATE MIDLET WHICH IS A GPRS BASED SOLUTION AND WILL PROVIDE THE SALES PERSONNEL WITH A LIST OF MENU ITEMS. TH SALES PERSONNEL... SALES DATA FROM THE SERVER. THIS MIDLET IS FOR THE PROJECT MEDICAL CENTRAL
project
project  i need a project in java backend sql
PROJECT
PROJECT  i want online polling system project codding
project
project  suggest a network security project based on core java with explanation
Java Project - Java Beginners
Java Project   Write a Java program to create simple Calculator for 4 basic Math operations, Addition, Subtraction, Multiplication and Division. The calculator should simulate the look of handheld calculator containing
java project question
java project question  how to calculate bill extracting quantity n..., we used following database table: 1)items CREATE TABLE `items...`) ) 2)total CREATE TABLE `total
project
project  sir i want a java major project in railway reservation plz help me and give a project source code with entire validation thank you
project
project  does hostel management system project contain any dynamic web pages
project
project  sir i want module and source code on my project hospital management system
Final Project - Java Beginners
in programming is paramount in being successful in the business industry. This project..., but it is suggested that you begin working on the final project assignment in Week 5, which should give you ample time to complete the project. You will find that all
PROJECT
PROJECT  i want help on making project on mobile banking application..... the application should have SAVING ACCOUNT,CURRENT ACCOUNT,TRANSACTION ETC......... IN APPLICATION
Project
Project  How to show Questions randomly so that no two student get the same questions in online examination system project in Java Server Pages my email id is moiza_sayyed@rediffmail.com
project
project  sir i want to a project on railway reservation,sir plz give me the source code   plz give me the source code of railway reservation
project
project   hi , we r working on one project related to our results. we using java and for back end sqlserver 2005. In dis we are trying to retrieve result from some site and store it in our data base so that we can perform
Java Project - Java Beginners
Java Project  Create a class Computer that stores information about.... If all values are valid then create the objects and display the details... question in my java project. But this program is shoing error on the 50th line
Project
Project  Hi, Am starting a new project to draw a 2d graph using java swing and opengl,where in the input for X-axis and Y-axis co=ordinates should be accepted from user... As am very new to this am seeking help so pls help
project
project  For my project their is 2 users, one is users and administers.i want code for giving authentication to these users by using one, means same login form and database table ..my back end is mysgl....and am using wamp sever
EJB Deployment how to create a simple ejd session bean and how to do project setup
EJB Deployment how to create a simple ejd session bean and how to do project..., jdk 1.6 installed in my system. how to create a simple ejd session bean and how to do project setup...? please help me i am getting difficult
project..
project..  Write a program to find the result of N students by accepting 5-subject marks from a Mark class and calculate the total and average mark. Display the result of all students in ascending order of rank from Result class
Select your project and right click on the it
Creating files in JPA project   ...; project, you need to follow the following steps: Select "JPACRUDApplication" project and right click on it. Select New => Package
Help in making school project
to create a simple program that will allow the doctor to keep track of how
Project
); hrm.close(); String stud_name=(String) vdata.get(1); String project_name=(String) vdata.get(2); String project_type=(String) vdata.get(3); String receipt
Project
); hrm.close(); String stud_name=(String) vdata.get(1); String project_name=(String) vdata.get(2); String project_type=(String) vdata.get(3); String receipt

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.