TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
J Kasthu
NA
7
1.1k
How to control another jframe buttons from login jframe..
Jan 5 2018 11:12 PM
try{ String sql = "SELECT * from tbluserlogin WHERE Name = '"+ txtusername.getText().toString()+"' AND Password= '"+txtpassword.getText()+"' AND Branch = '"+ CboDepartment.getSelectedItem().toString()+"' "; pst = conn.prepareStatement(sql); rs=pst.executeQuery(sql); rs.next(); String name = rs.getString("Branch"); if (name.equals("Admin")) { Main ah = new Main(); ah.setVisible(true); this.dispose(); } else if(name.equals("Minor Offense")){ new Main().setVisible(true); this.dispose(); } else if(name.equals("Traffic Branch")){ new Main().setVisible(true); this.dispose(); } else if(name.equals("Child @ Women Branch")){ new Main().setVisible(true); this.dispose(); } else if(name.equals("Crime Branch")){ new Main().setVisible(true); this.dispose(); } else { JOptionPane.showMessageDialog(null, "Connot Login"); txtusername.setText(""); txtpassword.setText(""); CboDepartment.setSelectedIndex(-1); } } catch (Exception e){ JOptionPane.showMessageDialog(null, e); }
Reply
Answers (
0
)
Java-Netbeans , SQL_Wampsever
We use inner classes to logically group classes nd interfcs?