📄 dailypperationsystempanel.java
字号:
jLabel16.setText("图书类别名");
jLabel16.setBounds(new Rectangle(260, 16, 82, 16));
jLabel17.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel17.setForeground(Color.blue);
jLabel17.setText("图书编号");
jLabel17.setBounds(new Rectangle(11, 49, 56, 16));
btnReturnBooks.setBounds(new Rectangle(90, 138, 73, 25));
btnReturnBooks.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnReturnBooks.setForeground(Color.blue);
btnReturnBooks.setText("归还");
btnReturnBooks.addActionListener(new
DailyPperationSystemPanel_btnReturnBooks_actionAdapter(this));
jTxbookNumG.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxbookNumG.setForeground(SystemColor.activeCaption);
jTxbookNumG.setBounds(new Rectangle(76, 44, 155, 22));
jtxbooksNameG.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jtxbooksNameG.setForeground(SystemColor.activeCaption);
jtxbooksNameG.setBounds(new Rectangle(76, 13, 155, 22));
jTxbookConcernG.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxbookConcernG.setForeground(SystemColor.activeCaption);
jTxbookConcernG.setBounds(new Rectangle(341, 44, 155, 22));
jLabel18.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel18.setForeground(Color.blue);
jLabel18.setText("图书名称");
jLabel18.setBounds(new Rectangle(11, 16, 56, 16));
jTxbookAuthorG.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxbookAuthorG.setForeground(SystemColor.activeCaption);
jTxbookAuthorG.setText("");
jTxbookAuthorG.setBounds(new Rectangle(76, 76, 155, 22));
jLabel19.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel19.setForeground(Color.blue);
jLabel19.setText("图书的定价");
jLabel19.setBounds(new Rectangle(260, 78, 82, 16));
jLabel3.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel3.setForeground(Color.blue);
jLabel3.setText("图书出版社");
jLabel3.setBounds(new Rectangle(260, 49, 82, 16));
jLabel20.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel20.setForeground(Color.blue);
jLabel20.setText("图书作者");
jLabel20.setBounds(new Rectangle(12, 78, 56, 16));
jTxpurchaseMoneyD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxpurchaseMoneyD.setForeground(SystemColor.activeCaption);
jTxpurchaseMoneyD.setText("");
jTxpurchaseMoneyD.setBounds(new Rectangle(342, 76, 155, 22));
jTxpurchaseMoneyD.addMouseListener(new
DailyPperationSystemPanel_jTxpurchaseMoneyD_mouseAdapter(this));
btnRsectD.setBounds(new Rectangle(356, 136, 73, 25));
btnRsectD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnRsectD.setForeground(Color.blue);
btnRsectD.setText("重置");
jTxbookTypeD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxbookTypeD.setForeground(SystemColor.activeCaption);
jTxbookTypeD.setText("");
jTxbookTypeD.setBounds(new Rectangle(342, 14, 155, 22));
jLabel21.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel21.setForeground(Color.blue);
jLabel21.setText("图书类别名");
jLabel21.setBounds(new Rectangle(260, 16, 82, 16));
jLabel22.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel22.setForeground(Color.blue);
jLabel22.setText("图书编号");
jLabel22.setBounds(new Rectangle(11, 49, 56, 16));
BtnQuerenD.setBounds(new Rectangle(90, 136, 73, 25));
BtnQuerenD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
BtnQuerenD.setForeground(Color.blue);
BtnQuerenD.setMargin(new Insets(2, 1, 2, 1));
BtnQuerenD.setText("确认丢失");
jTxbookNumD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxbookNumD.setForeground(SystemColor.activeCaption);
jTxbookNumD.setBounds(new Rectangle(76, 44, 155, 22));
jtxbooksNamexD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jtxbooksNamexD.setForeground(SystemColor.activeCaption);
jtxbooksNamexD.setBounds(new Rectangle(76, 13, 155, 22));
jTxbookConcernD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxbookConcernD.setForeground(SystemColor.activeCaption);
jTxbookConcernD.setBounds(new Rectangle(341, 44, 155, 22));
jLabel23.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel23.setForeground(Color.blue);
jLabel23.setText("图书名称");
jLabel23.setBounds(new Rectangle(11, 16, 56, 16));
jTxbookAuthorD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxbookAuthorD.setForeground(SystemColor.activeCaption);
jTxbookAuthorD.setText("");
jTxbookAuthorD.setBounds(new Rectangle(76, 76, 155, 22));
jLabel24.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel24.setForeground(Color.blue);
jLabel24.setText("图书的定价");
jLabel24.setBounds(new Rectangle(260, 78, 82, 16));
//获取表头设置字体
jTabRightTop.getTableHeader().setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTabRightTop.getTableHeader().setForeground(Color.blue);
jTabRightTop.setRowHeight(20);
jTabRightTop.addMouseListener(new
DailyPperationSystemPanel_jTabRightTop_mouseAdapter(this));
jTreBooks.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
jTreBooks.setForeground(Color.blue);
jLabel25.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel25.setForeground(Color.magenta);
jLabel25.setText("读者编号");
jLabel25.setBounds(new Rectangle(11, 110, 56, 16));
jTxNumber.setBackground(SystemColor.inactiveCaptionText);
jTxNumber.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxNumber.setForeground(Color.magenta);
jTxNumber.setBorder(BorderFactory.createEtchedBorder());
jTxNumber.setText("点击查询当前读者的借书数量");
jTxNumber.setBounds(new Rectangle(341, 108, 195, 22));
jTxNumber.addMouseListener(new
DailyPperationSystemPanel_jTxNumber_mouseAdapter(this));
jTxreaderNum.setBackground(SystemColor.inactiveCaptionText);
jTxreaderNum.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxreaderNum.setForeground(Color.magenta);
jTxreaderNum.setText("点击输入读者信息");
jTxreaderNum.setBounds(new Rectangle(76, 108, 155, 22));
jTxreaderNum.addMouseListener(new
DailyPperationSystemPanel_jTxreaderNum_mouseAdapter(this));
jLabel26.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel26.setForeground(Color.magenta);
jLabel26.setText("在借书数量");
jLabel26.setBounds(new Rectangle(259, 110, 82, 16));
jLabel27.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel27.setForeground(Color.magenta);
jLabel27.setText("在借书数量");
jLabel27.setBounds(new Rectangle(259, 110, 82, 16));
jTxReaderNumX.setBackground(SystemColor.inactiveCaptionText);
jTxReaderNumX.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxReaderNumX.setForeground(Color.magenta);
jTxReaderNumX.setBounds(new Rectangle(76, 108, 155, 22));
jTxReaderNumX.addMouseListener(new
DailyPperationSystemPanel_jTxReaderNumX_mouseAdapter(this));
jLabel28.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel28.setForeground(Color.magenta);
jLabel28.setText("读者编号");
jLabel28.setBounds(new Rectangle(11, 110, 56, 16));
jTxNumberX.setBackground(SystemColor.inactiveCaptionText);
jTxNumberX.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxNumberX.setForeground(Color.magenta);
jTxNumberX.setBounds(new Rectangle(341, 108, 155, 22));
jTxNumberX.addMouseListener(new
DailyPperationSystemPanel_jTxNumberX_mouseAdapter(this));
jLabel29.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel29.setForeground(Color.magenta);
jLabel29.setText("在借书数量");
jLabel29.setBounds(new Rectangle(259, 110, 82, 16));
jTxReaderNumG.setBackground(SystemColor.inactiveCaptionText);
jTxReaderNumG.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxReaderNumG.setForeground(Color.magenta);
jTxReaderNumG.setBounds(new Rectangle(76, 108, 155, 22));
jTxReaderNumG.addMouseListener(new
DailyPperationSystemPanel_jTxReaderNumG_mouseAdapter(this));
jLabel30.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel30.setForeground(Color.magenta);
jLabel30.setText("读者编号");
jLabel30.setBounds(new Rectangle(11, 110, 56, 16));
jTxNumberG.setBackground(SystemColor.inactiveCaptionText);
jTxNumberG.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxNumberG.setForeground(Color.magenta);
jTxNumberG.setBounds(new Rectangle(341, 108, 155, 22));
jTxNumberG.addMouseListener(new
DailyPperationSystemPanel_jTxNumberG_mouseAdapter(this));
jLabel31.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel31.setForeground(Color.magenta);
jLabel31.setText("在借书数量");
jLabel31.setBounds(new Rectangle(259, 110, 82, 16));
jTxReaderNumD.setBackground(SystemColor.inactiveCaptionText);
jTxReaderNumD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxReaderNumD.setForeground(Color.magenta);
jTxReaderNumD.setBounds(new Rectangle(76, 108, 155, 22));
jTxReaderNumD.addMouseListener(new
DailyPperationSystemPanel_jTxReaderNumD_mouseAdapter(this));
jLabel32.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel32.setForeground(Color.magenta);
jLabel32.setText("读者编号");
jLabel32.setBounds(new Rectangle(11, 110, 56, 16));
jTxNumberD.setBackground(SystemColor.inactiveCaptionText);
jTxNumberD.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTxNumberD.setForeground(Color.magenta);
jTxNumberD.setBounds(new Rectangle(341, 108, 155, 22));
jPanRight.addComponentListener(new
DailyPperationSystemPanel_jPanRight_componentAdapter(this));
jSpSystemPanel.setSize( (this.getWidth())-5,(this.getHeight()-5));
jPanRight.setSize((jSpSystemPanel.getWidth()- jScleft.getWidth()),(jSpSystemPanel.getHeight()-1));
jPanRight.setBorder(BorderFactory.createLineBorder(Color.black));
this.add(jPanelSystemTop);
jPanelSystemTop.add(jBttsjy);
this.add(jSpSystemPanel);
jSpSystemPanel.add(jScleft, JSplitPane.LEFT);
jSpSystemPanel.add(jScright, JSplitPane.RIGHT);
jScright.getViewport().add(jPanRight);
jPanRight.add(jPaneRightBottom);
jPanRight.add(jPanelRightTop);
jPanelRightTop.add(jScrollPane1);
jScrollPane1.getViewport().add(jTabRightTop);
jPaneRightBottom.add(jTpRightBottom);
jTpRightBottomPane1.add(jLabel9);
jTpRightBottomPane1.add(jLabel8);
jTpRightBottomPane1.add(jLabel2);
jTpRightBottomPane1.add(jLabel7);
jTpRightBottomPane1.add(jTxbookNum);
jTpRightBottomPane1.add(jTxbookName);
jTpRightBottomPane1.add(jTxbookType);
jTpRightBottomPane1.add(jTxbookConcern);
jTpRightBottomPane1.add(btnQueren);
jTpRightBottomPane1.add(btnReset);
jTpRightBottomPane1.add(jLabel5);
jTpRightBottomPane1.add(jLabel4);
jTpRightBottomPane1.add(jTxbookAuthor);
jTpRightBottomPane1.add(jTxpurchaseMoney);
jTpRightBottomPane1.add(jLabel26);
jTpRightBottomPane1.add(jLabel25);
jTpRightBottomPane1.add(jTxreaderNum);
jTpRightBottomPane1.add(jTxNumber);
jScleft.getViewport().add(jTreBooks);
jTpRightBottom.add(jTpRightBottomPane1, "图书借阅业务处理 ");
jTpRightBottom.add(jTpRightBottomjPanel3, "图书归还业务处理 ");
jTpRightBottom.add(jTpRightBottomjPanel2, "图书续借业务处理 ");
jTpRightBottomjPanel2.add(jLabel6);
jTpRightBottomjPanel2.add(jLabel10);
jTpRightBottomjPanel2.add(jTxpurchaseMoneyX);
jTpRightBottomjPanel2.add(jtxbookTypeX);
jTpRightBottomjPanel2.add(jLabel11);
jTpRightBottomjPanel2.add(jLabel12);
jTpRightBottomjPanel2.add(jtxbooksNumX);
jTpRightBottomjPanel2.add(jtxbooksNamex);
jTpRightBottomjPanel2.add(jTxbookConcernX);
jTpRightBottomjPanel2.add(jLabel13);
jTpRightBottomjPanel2.add(jTxbookAuthorX);
jTpRightBottomjPanel2.add(jLabel14);
jTpRightBottomjPanel2.add(jButton5);
jTpRightBottomjPanel2.add(jButton6);
jTpRightBottomjPanel2.add(jLabel27);
jTpRightBottomjPanel2.add(jTxReaderNumX);
jTpRightBottomjPanel2.add(jLabel28);
jTpRightBottomjPanel2.add(jTxNumberX);
jTpRightBottomjPanel3.add(jLabel1);
jTpRightBottomjPanel3.add(jLabel15);
jTpRightBottomjPanel3.add(jTxpurchaseMoneyG);
jTpRightBottomjPanel3.add(jTxbookTypeG);
jTpRightBottomjPanel3.add(jLabel16);
jTpRightBottomjPanel3.add(jLabel17);
jTpRightBottomjPanel3.add(jTxbookNumG);
jTpRightBottomjPanel3.add(jtxbooksNameG);
jTpRightBottomjPanel3.add(jTxbookConcernG);
jTpRightBottomjPanel3.add(jLabel18);
jTpRightBottomjPanel3.add(jTxbookAuthorG);
jTpRightBottomjPanel3.add(jLabel19);
jTpRightBottomjPanel3.add(jLabel29);
jTpRightBottomjPanel3.add(jTxReaderNumG);
jTpRightBottomjPanel3.add(jLabel30);
jTpRightBottomjPanel3.add(jTxNumberG);
jTpRightBottomjPanel3.add(jButton1);
jTpRightBottomjPanel3.add(btnReturnBooks);
jTpRightBottom.add(jTpRightBottomjPanel4, "图书丢失业务处理 ");
jTpRightBottomjPanel4.add(jLabel3);
jTpRightBottomjPanel4.add(jLabel20);
jTpRightBottomjPanel4.add(jTxpurchaseMoneyD);
jTpRightBottomjPanel4.add(jTxbookTypeD);
jTpRightBottomjPanel4.add(jLabel21);
jTpRightBottomjPanel4.add(jLabel22);
jTpRightBottomjPanel4.add(jTxbookNumD);
jTpRightBottomjPanel4.add(jtxbooksNamexD);
jTpRightBottomjPanel4.add(jTxbookConcernD);
jTpRightBottomjPanel4.add(jLabel23);
jTpRightBottomjPanel4.add(jTxbookAuthorD);
jTpRightBottomjPanel4.add(jLabel24);
jTpRightBottomjPanel4.add(jLabel31);
jTpRightBottomjPanel4.add(jTxReaderNumD);
jTpRightBottomjPanel4.add(jLabel32);
jTpRightBottomjPanel4.add(jTxNumberD);
jTpRightBottomjPanel4.add(btnRsectD);
jTpRightBottomjPanel4.add(BtnQuerenD);
jTpRightBottom.setSelectedComponent(jTpRightBottomPane1);
}
public void loginTree()
{
ResultSet re = null;
DefaultMutableTreeNode bookstype[];
int size = 0;
int j = 0;
int i = 0;
int arry[] = new int[26];
//连接数据库
// if (db.getconn()) {
//获得结果集
re = db.searchTree();
try {
while (re.next())
size++;
bookstype = new DefaultMutableTreeNode[size];
boolean a = re.first();
for (i = 0, j = 0; a; i++) {
String booktypeNum = re.getString(1).trim();
String booktypeName = re.getString(2).trim();
//创建树的枝
if (booktypeNum.length() == 1) {
arry[j] = i;
j++;
bookstype[i] = new DefaultMutableTreeNode(booktypeName);
} else {
//创建树的叶
bookstype[i] = new DefaultMutableTreeNode(booktypeName);
}
a = re.next();
}
for (i = 0, j = 0; i < bookstype.length; i++) {
if (i == arry[j]) {
j++;
books.add(bookstype[i]);
} else {
bookstype[arry[j - 1]].add(bookstype[i]);
}
}
} catch (SQLException ex) {
System.out.println(ex.toString());
}
jTreBooks.updateUI();
db.myClose(1);
// } else
// JOptionPane.showMessageDialog(this, "连接数据库失败", "连接错误",JOptionPane.WARNING_MESSAGE);
}
public void display()
{
DefaultMutableTreeNode clickNode = (DefaultMutableTreeNode) jTreBooks.getLastSelectedPathComponent();
String sql;
ResultSet rs;
String[][] data;
String bti="";
//数据库表没有见
if (clickNode != null ) {
//查询条件许转换
if(clickNode.toString().trim().equals("所有图书"))
{
bti="%";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -