最后
本人也收藏了一份Java面试核心知识点来应付面试,借着这次机会可以送给我的读者朋友们:
目录:
Java面试核心知识点
一共有30个专题,足够读者朋友们应付面试啦,也节省朋友们去到处搜刮资料自己整理的时间!
Java面试核心知识点
=====================================================================
package com.sjsq.model;
/**
-
@author shuijianshiqing
-
@date 2020-08-30 18:32
*/
public class Room {
String id;// 寝室号
String member;// 成员
String leader;// 寝室长
// 构造函数
public Room(String member) {
super();
this.member = member;
}
public Room() {
super();
}
public Room(String id, String member, String leader) {
super();
this.id = id;
this.member = member;
this.leader = leader;
}
public Room(String member, String leader) {
super();
this.member = member;
this.leader = leader;
}
// get,set方法
public String getMember() {
return member;
}
public void setMember(String member) {
this.member = member;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String toString() {
return this.getMember();
}
}
package com.sjsq.model;
/**
-
学生实体类
-
@author shuijianshiqing
-
@date 2020-09-01 07:02
*/
public class Student {
int id;
String name;
String sex;
String yuanxi;
String classroom;
int dormitory = -1;
int bed;
public Student(String name) {
super();
this.name = name;
}
public Student(int id, String name, String sex, String yuanxi, String classroom, int dormitory, int bed) {
super();
this.id = id;
this.name = name;
this.sex = sex;
this.yuanxi = yuanxi;
this.classroom = classroom;
this.dormitory = dormitory;
this.bed = bed;
}
public Student(String name, String sex, String yuanxi, String classroom, int dormitory, int bed) {
super();
this.name = name;
this.sex = sex;
this.yuanxi = yuanxi;
this.classroom = classroom;
this.dormitory = dormitory;
this.bed = bed;
}
public Student() {
super();
}
public Student(String name, String sex, String yuanxi, String classroom, int dormitory) {
super();
this.name = name;
this.sex = sex;
this.yuanxi = yuanxi;
this.classroom = classroom;
this.dormitory = dormitory;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getYuanxi() {
return yuanxi;
}
public void setYuanxi(String yuanxi) {
this.yuanxi = yuanxi;
}
public String getClassroom() {
return classroom;
}
public void setClassroom(String classroom) {
this.classroom = classroom;
}
public int getDormitory() {
return dormitory;
}
public void setDormitory(int dormitory) {
this.dormitory = dormitory;
}
public int getBed() {
return bed;
}
public void setBed(int bed) {
this.bed = bed;
}
}
package com.sjsq.model;
/**
-
User实体类
-
@author shuijianshiqing
-
@date 2020-09-01 07:02
*/
public class User {
String id;
String userName;
String userPassword;
public User() {
super();
}
public User(String userName, String userPassword) {
super();
this.userName = userName;
this.userPassword = userPassword;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPassword() {
return userPassword;
}
public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}
@Override
public String toString() {
return this.getUserName();
}
}
package com.sjsq.util;
import java.sql.Connection;
import java.sql.DriverManager;
/**
-
数据库工具连接类
-
@author shuijianshiqing
-
@date 2020-09-01 07:03
*/
public class DMUtil {
// URL链接
private String url = “jdbc:mysql://localhost:3306/dormitory_management_swing?serverTimezone=UTC”;
// 账号
private String userName = “root”;
// 密码
private String userPassword = “admin”;
// JDBC驱动
private String jdbcName = “com.mysql.cj.jdbc.Driver”;
// 链接
public Connection getCon() throws Exception {
Class.forName(jdbcName);
Connection con = DriverManager.getConnection(url, userName, userPassword);
return con;
}
// 关闭链接
public void closeCon(Connection con) throws Exception {
if (con != null) {
con.close();
}
}
// 测试
public static void main(String[] args) {
DMUtil dmutil = new DMUtil();
Connection con = null;
try {
con = dmutil.getCon();
System.out.println(“数据库连接成功!”);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
dmutil.closeCon(con);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
package com.sjsq.util;
/**
-
字符串工具类
-
@author shuijianshiqing
-
@date 2020-09-01 07:03
*/
public class StringUtil {
// 判断字符串是否是""
public static boolean isEmpty(String type) {
if (type.equals(“”)) {
return true;
} else {
return false;
}
}
// 判断字符串不为空
public static boolean isNotEmpty(String type) {
if (type != null && !type.equals(“”)) {
return true;
} else {
return false;
}
}
}
package com.sjsq.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import com.sjsq.model.Room;
import com.sjsq.util.StringUtil;
/**
-
操作宿舍信息
-
@author shuijianshiqing
-
@date 2020-09-01 07:07
*/
public class RoomDao {
// 添加宿舍信息
public int roomAdd(Connection con, Room room) throws Exception {
String sql = “insert into room_message values(null,?,?)”;
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setString(1, room.getMember());
pstmt.setString(2, room.getLeader());
return pstmt.executeUpdate();
}
// 查询宿舍信息
public ResultSet roomList(Connection con, Room room) throws Exception {
StringBuffer sb = new StringBuffer(“select * from room_message”);
if (StringUtil.isNotEmpty(room.getMember())) {
String member = room.getMember();
sb.append(" and member like ‘%" + room.getMember() + "%’");
}
PreparedStatement pstmt = con.prepareStatement(sb.toString().replaceFirst(“and”, “where”));
return pstmt.executeQuery();
}
// 修改宿舍信息
public int roomModify(Connection con, Room room) throws Exception {
String sql = “update room_message set member=?,leader=? where id=?”;
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setString(1, room.getMember());
pstmt.setString(2, room.getLeader());
pstmt.setString(3, room.getId());
return pstmt.executeUpdate();
}
// 删除宿舍信息
public int roomDelete(Connection con, Room room) throws Exception {
String sql = “delete from room_message where member=?”;
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setString(1, room.getMember());
return pstmt.executeUpdate();
}
}
package com.sjsq.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import com.sjsq.model.User;
/**
-
返回学生信息
-
@author shuijianshiqing
-
@date 2020-09-01 07:07
*/
public class UserDao {
// 登录
public User Login(Connection con, User user) throws Exception {
User currentuser = null;
String sql = “select * from d_user where userName=? and userPassword=?”;
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setString(1, user.getUserName());
pstmt.setString(2, user.getUserPassword());
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
currentuser = new User();
currentuser.setUserName(rs.getString(“userName”));
currentuser.setUserPassword(rs.getString(“userPassword”));
}
return currentuser;
}
}
package com.sjsq.view;
import java.awt.Font;
import java.sql.Connection;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import com.sjsq.dao.UserDao;
import com.sjsq.model.User;
import com.sjsq.util.DMUtil;
import com.sjsq.util.StringUtil;
/**
-
登录界面
-
@author 刁雨健 dyj
-
@author shuijianshiqing
-
@date 2020-09-01 07:41
*/
public class LoginFrm extends javax.swing.JFrame {
private JLabel jLabel1;
private JLabel jLabel2;
private JLabel jLabel3;
private JLabel jLabel4;
private JButton jb_login;
private JButton jb_reset;
private JComboBox jcb_choose;
private JTextField userNameTxt;
private JPasswordField userPasswordTxt;
DMUtil dmutil = new DMUtil();
UserDao userdao = new UserDao();
/**
- 创建窗体
*/
public LoginFrm() {
Font font = new Font(“Dialog”, Font.PLAIN, 12);
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, font);
}
}
// 初始化
initComponents();
// 居中
this.setLocationRelativeTo(null);
this.filltable();
}
// 填充表格
private void filltable() {
User user1 = new User();
User user2 = new User();
user1.setUserName(“学生”);
user2.setUserName(“管理员”);
user1.setId(1 + “”);
user2.setId(2 + “”);
jcb_choose.addItem(user1);
jcb_choose.addItem(user2);
}
// 初始化
private void initComponents() {
jLabel1 = new JLabel(“General”, JLabel.CENTER);
jLabel2 = new JLabel();
jLabel3 = new JLabel();
userNameTxt = new JTextField();
userPasswordTxt = new JPasswordField();
jb_login = new JButton();
jb_reset = new JButton();
jcb_choose = new JComboBox();
jLabel4 = new JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle(“学生宿舍管理系统登录界面”);
setResizable(false);
jLabel1.setFont(new Font(“宋体”, 0, 24));
jLabel1.setText(“学生宿舍管理系统”);
// 用户名
jLabel2.setIcon(new ImageIcon(LoginFrm.class.getResource(“/images/user.png”)));
jLabel2.setText(“账号:”);
// 密码
jLabel3.setIcon(new ImageIcon(LoginFrm.class.getResource(“/images/password.png”)));
jLabel3.setText(“密码:”);
userNameTxt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
userNameTxtActionPerformed(evt);
}
});
// 登录
jb_login.setIcon(new ImageIcon(LoginFrm.class.getResource(“/images/login.png”)));
jb_login.setText(“登录”);
jb_login.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jb_loginActionPerformed(evt);
}
});
// 重置
jb_reset.setIcon(new ImageIcon(LoginFrm.class.getResource(“/images/reset.png”))); // NOI18N
jb_reset.setText(“重置”);
jb_reset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jb_resetActionPerformed(evt);
}
});
jLabel4.setIcon(new ImageIcon(LoginFrm.class.getResource(“/images/type.png”))); // NOI18N
jLabel4.setText(“用户类型:”);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup().addGap(103, 103, 103).addComponent(jLabel1)
.addContainerGap(58, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout
.createSequentialGroup().addGroup(layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING).addGroup(
layout.createSequentialGroup().addContainerGap().addComponent(
jLabel4).addGap(42, 42, 42).addComponent(jcb_choose,
javax.swing.GroupLayout.PREFERRED_SIZE, 111,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup().addGap(103, 103, 103)
.addGroup(layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel3).addComponent(jLabel2)))
.addGroup(layout
.createSequentialGroup().addGap(104, 104, 104)
.addComponent(jb_login)))
.addGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup().addGap(42, 42, 42)
.addGroup(layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(userNameTxt,
javax.swing.GroupLayout.DEFAULT_SIZE,
111, Short.MAX_VALUE)
.addComponent(userPasswordTxt,
javax.swing.GroupLayout.DEFAULT_SIZE,
111, Short.MAX_VALUE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup().addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jb_reset).addGap(25, 25, 25)))))
.addGap(100, 100, 100)));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout
.createSequentialGroup().addGap(60, 60, 60).addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel2)
.addComponent(userNameTxt, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel3)
.addComponent(userPasswordTxt, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel4)
.addComponent(jcb_choose, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jb_login).addComponent(jb_reset))
.addContainerGap(34, Short.MAX_VALUE)));
pack();
}
// 登录事件监控
private void jb_loginActionPerformed(java.awt.event.ActionEvent evt) {
String userName = userNameTxt.getText();
String userPassword = new String(userPasswordTxt.getPassword());
if (StringUtil.isEmpty(userName)) {
JOptionPane.showMessageDialog(null, “用户名不能为空!”);
return;
} else if (StringUtil.isEmpty(userPassword)) {
JOptionPane.showMessageDialog(null, “密码不能为空!”);
return;
}
User user = new User(userName, userPassword);
Connection con = null;
try {
con = dmutil.getCon();
User currentuser = userdao.Login(con, user);
if (currentuser != null) {
User user1 = (User) jcb_choose.getSelectedItem();
String userright = user1.getUserName();
if (userright.equals(“管理员”)) {
this.dispose();
MainFrm main = new MainFrm();
main.setVisible(true);
} else if (userright.equals(“学生”)) {
this.dispose();
MainFrm2 main2 = new MainFrm2();
main2.setVisible(true);
} else {
JOptionPane.showMessageDialog(null, “用户名密码错误!”);
}
}
} catch (Exception e) {
JOptionPane.showInternalMessageDialog(null, “登陆失败”);
e.printStackTrace();
}
}
// 重置事件监控
private void jb_resetActionPerformed(java.awt.event.ActionEvent evt) {
this.userNameTxt.setText(“”);
this.userPasswordTxt.setText(“”);
}
private void userNameTxtActionPerformed(java.awt.event.ActionEvent evt) {
}
// 主函数
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LoginFrm().setVisible(true);
}
});
}
}
package com.sjsq.view;
import javax.swing.JDesktopPane;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
/**
-
学生主页面
-
@author shuijianshiqing
-
@date 2020-09-01 07:52
*/
public class MainFrm2 extends javax.swing.JFrame {
private JMenu jMenu1;
private JMenu jMenu3;
private JMenu jMenu2;
private JMenuBar jMenuBar1;
private JMenuItem jMenuItem1;
private JMenuItem jMenuItem2;
private JMenuItem jMenuItem3;
private JMenuItem jMenuItem4;
private JMenuItem jMenuItem5;
private JMenuItem jMenuItem6;
private JDesktopPane table;
/**
- 创建窗体
*/
public MainFrm2() {
initComponents();
// 设置位置
setBounds(100, 200, 1050, 650);
// 居中显示
this.setLocationRelativeTo(null);
}
/**
- 初始化窗体
*/
private void initComponents() {
table = new JDesktopPane();
jMenuBar1 = new JMenuBar();
jMenu1 = new JMenu();
jMenuItem2 = new JMenuItem();
jMenuItem3 = new JMenuItem();
jMenu2 = new JMenu();
jMenuItem1 = new JMenuItem();
jMenuItem4 = new JMenuItem();
jMenu3 = new JMenu();
jMenuItem5 = new JMenuItem();
jMenuItem6 = new JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle(“学生信息管理学生页面”);
// 设置导航栏
jMenu1.setText(“学生入住”);
jMenuItem2.setText(“办理入住”);
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem2);
jMenuItem3.setText(“信息修改”);
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem3);
jMenuBar1.add(jMenu1);
jMenu2.setText(“信息查询”);
jMenuItem1.setText(“寝室查询”);
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem1);
jMenuItem4.setText(“人员查询”);
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem4);
jMenuBar1.add(jMenu2);
jMenu3.setText(“帮助服务”);
jMenuItem5.setText(“关于系统”);
jMenu3.add(jMenuItem5);
jMenuItem6.setText(“退出系统”);
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem6);
jMenuBar1.add(jMenu3);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(table, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(table, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE));
pack();
}
// 事件监控
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {
int a = JOptionPane.showConfirmDialog(null, “确定要退出?”);
if (a == 0) {
this.dispose();
}
}
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
RoomSearchInterFrm roomSearch = new RoomSearchInterFrm();
roomSearch.setVisible(true);
this.table.add(roomSearch);
}
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {
StudentSearchInterFrm StudentSearch = new StudentSearchInterFrm();
StudentSearch.setVisible(true);
this.table.add(StudentSearch);
}
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
StudentModifyInterFrm StudentModify = new StudentModifyInterFrm();
StudentModify.setVisible(true);
this.table.add(StudentModify);
}
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
StudentAddInterFrm Student = new StudentAddInterFrm();
Student.setVisible(true);
this.table.add(Student);
}
// 主函数
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainFrm2().setVisible(true);
}
});
}
}
package com.sjsq.view;
import java.sql.Connection;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JButton;
import com.sjsq.dao.RoomDao;
import com.sjsq.model.Room;
import com.sjsq.util.DMUtil;
/**
-
房间信息添加
-
@author shuijianshiqing
-
@date 2020-09-01 20:51
*/
public class RoomAddInterFrm extends javax.swing.JInternalFrame {
private JTextField dm_leader;
private JTextField dm_number;
private JLabel jLabel1;
private JLabel jLabel2;
private JLabel jLabel3;
private JButton jb_add;
private JButton jb_reset;
DMUtil dmutil = new DMUtil();
RoomDao roomdao = new RoomDao();
public RoomAddInterFrm() {
initComponents();
this.setLocation(200, 50);
}
private void initComponents() {
jLabel1 = new JLabel();
dm_number = new JTextField();
jLabel2 = new JLabel();
dm_leader = new JTextField();
jb_add = new JButton();
jb_reset = new JButton();
jLabel3 = new JLabel();
setClosable(true);
setIconifiable(true);
setTitle(“宿舍添加”);
jLabel1.setText(“宿舍号:”);
jLabel2.setText(“寝室长:”);
jb_add.setText(“添加”);
jb_add.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jb_addActionPerformed(evt);
}
});
jb_reset.setText(“重置”);
jb_reset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jb_resetActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout
.createSequentialGroup().addGap(150, 150, 150)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup().addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(dm_leader, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup().addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(dm_number, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup().addComponent(jb_add).addGap(18, 18, 18)
.addComponent(jb_reset)))
.addGap(4, 4, 4).addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 170,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(25, 25, 25)));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout
.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addGroup(layout
.createSequentialGroup().addGap(29, 29, 29)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1).addComponent(dm_number, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(70, 70, 70)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2).addComponent(dm_leader, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 91, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jb_reset).addComponent(jb_add)))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup().addGap(27, 27, 27).addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 222,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(40, Short.MAX_VALUE)));
pack();
}
private void jb_addActionPerformed(java.awt.event.ActionEvent evt) {
String name = dm_number.getText();
String leader = dm_leader.getText();
Room room = new Room(name, leader);
Connection con = null;
try {
con = dmutil.getCon();
int a = roomdao.roomAdd(con, room);
if (a == 1) {
JOptionPane.showMessageDialog(null, “添加成功!”);
this.resetValue();
} else {
JOptionPane.showMessageDialog(null, “添加失败!”);
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, “添加失败!”);
e.printStackTrace();
} finally {
try {
dmutil.closeCon(con);
} catch (Exception e) {
e.printStackTrace();
}
}
}
private void resetValue() {
this.dm_leader.setText(“”);
this.dm_number.setText(“”);
}
private void jb_resetActionPerformed(java.awt.event.ActionEvent evt) {
this.dm_number.setText(“”);
this.dm_leader.setText(“”);
}
}
package com.sjsq.view;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Vector;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import com.sjsq.dao.RoomDao;
import com.sjsq.model.Room;
import com.sjsq.util.DMUtil;
import com.sjsq.util.StringUtil;
/**
-
删除房间信息
-
@author shuijianshiqing
-
@date 2020-09-01 20:40
*/
public class RoomDeleteInterFrm extends javax.swing.JInternalFrame {
最后
分享一套我整理的面试干货,这份文档结合了我多年的面试官经验,站在面试官的角度来告诉你,面试官提的那些问题他最想听到你给他的回答是什么,分享出来帮助那些对前途感到迷茫的朋友。
面试经验技巧篇
- 经验技巧1 如何巧妙地回答面试官的问题
- 经验技巧2 如何回答技术性的问题
- 经验技巧3 如何回答非技术性问题
- 经验技巧4 如何回答快速估算类问题
- 经验技巧5 如何回答算法设计问题
- 经验技巧6 如何回答系统设计题
- 经验技巧7 如何解决求职中的时间冲突问题
- 经验技巧8 如果面试问题曾经遇见过,是否要告知面试官
- 经验技巧9 在被企业拒绝后是否可以再申请
- 经验技巧10 如何应对自己不会回答的问题
- 经验技巧11 如何应对面试官的“激将法”语言
- 经验技巧12 如何处理与面试官持不同观点这个问题
- 经验技巧13 什么是职场暗语
面试真题篇
- 真题详解1 某知名互联网下载服务提供商软件工程师笔试题
- 真题详解2 某知名社交平台软件工程师笔试题
- 真题详解3 某知名安全软件服务提供商软件工程师笔试题
- 真题详解4 某知名互联网金融企业软件工程师笔试题
- 真题详解5 某知名搜索引擎提供商软件工程师笔试题
- 真题详解6 某初创公司软件工程师笔试题
- 真题详解7 某知名游戏软件开发公司软件工程师笔试题
- 真题详解8 某知名电子商务公司软件工程师笔试题
- 真题详解9 某顶级生活消费类网站软件工程师笔试题
- 真题详解10 某知名门户网站软件工程师笔试题
- 真题详解11 某知名互联网金融企业软件工程师笔试题
- 真题详解12 国内某知名网络设备提供商软件工程师笔试题
- 真题详解13 国内某顶级手机制造商软件工程师笔试题
- 真题详解14 某顶级大数据综合服务提供商软件工程师笔试题
- 真题详解15 某著名社交类上市公司软件工程师笔试题
- 真题详解16 某知名互联网公司软件工程师笔试题
- 真题详解17 某知名网络安全公司校园招聘技术类笔试题
- 真题详解18 某知名互联网游戏公司校园招聘运维开发岗笔试题
资料整理不易,点个关注再走吧
}
}
private void resetValue() {
this.dm_leader.setText(“”);
this.dm_number.setText(“”);
}
private void jb_resetActionPerformed(java.awt.event.ActionEvent evt) {
this.dm_number.setText(“”);
this.dm_leader.setText(“”);
}
}
package com.sjsq.view;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Vector;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import com.sjsq.dao.RoomDao;
import com.sjsq.model.Room;
import com.sjsq.util.DMUtil;
import com.sjsq.util.StringUtil;
/**
-
删除房间信息
-
@author shuijianshiqing
-
@date 2020-09-01 20:40
*/
public class RoomDeleteInterFrm extends javax.swing.JInternalFrame {
最后
分享一套我整理的面试干货,这份文档结合了我多年的面试官经验,站在面试官的角度来告诉你,面试官提的那些问题他最想听到你给他的回答是什么,分享出来帮助那些对前途感到迷茫的朋友。
面试经验技巧篇
- 经验技巧1 如何巧妙地回答面试官的问题
- 经验技巧2 如何回答技术性的问题
- 经验技巧3 如何回答非技术性问题
- 经验技巧4 如何回答快速估算类问题
- 经验技巧5 如何回答算法设计问题
- 经验技巧6 如何回答系统设计题
- 经验技巧7 如何解决求职中的时间冲突问题
- 经验技巧8 如果面试问题曾经遇见过,是否要告知面试官
- 经验技巧9 在被企业拒绝后是否可以再申请
- 经验技巧10 如何应对自己不会回答的问题
- 经验技巧11 如何应对面试官的“激将法”语言
- 经验技巧12 如何处理与面试官持不同观点这个问题
- 经验技巧13 什么是职场暗语
[外链图片转存中…(img-XrqH3UB9-1715553894138)]
面试真题篇
- 真题详解1 某知名互联网下载服务提供商软件工程师笔试题
- 真题详解2 某知名社交平台软件工程师笔试题
- 真题详解3 某知名安全软件服务提供商软件工程师笔试题
- 真题详解4 某知名互联网金融企业软件工程师笔试题
- 真题详解5 某知名搜索引擎提供商软件工程师笔试题
- 真题详解6 某初创公司软件工程师笔试题
- 真题详解7 某知名游戏软件开发公司软件工程师笔试题
- 真题详解8 某知名电子商务公司软件工程师笔试题
- 真题详解9 某顶级生活消费类网站软件工程师笔试题
- 真题详解10 某知名门户网站软件工程师笔试题
- 真题详解11 某知名互联网金融企业软件工程师笔试题
- 真题详解12 国内某知名网络设备提供商软件工程师笔试题
- 真题详解13 国内某顶级手机制造商软件工程师笔试题
- 真题详解14 某顶级大数据综合服务提供商软件工程师笔试题
- 真题详解15 某著名社交类上市公司软件工程师笔试题
- 真题详解16 某知名互联网公司软件工程师笔试题
- 真题详解17 某知名网络安全公司校园招聘技术类笔试题
- 真题详解18 某知名互联网游戏公司校园招聘运维开发岗笔试题
[外链图片转存中…(img-BK5wGznH-1715553894139)]
资料整理不易,点个关注再走吧