📄 magazineinfosystempanel.java
字号:
jtxBookNum2.setForeground(Color.magenta);
jtxBookNum2.setText("请点击输入编号");
jtxBookNum2.setBounds(new Rectangle(96, 49, 189, 23));
jtxBookNum2.addMouseListener(new
MagazineInfoSystemPanel_jtxBookNum2_mouseAdapter(this));
jtxBookNum2.addActionListener(new
MagazineInfoSystemPanel_jtxBookNum2_actionAdapter(this));
jtxBookBorrowMoneyNum2.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jtxBookBorrowMoneyNum2.setForeground(Color.red);
jtxBookBorrowMoneyNum2.setText("");
jtxBookBorrowMoneyNum2.setBounds(new Rectangle(96, 137, 189, 23));
jLabel19.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel19.setForeground(Color.blue);
jLabel19.setText("期刊定价");
jLabel19.setBounds(new Rectangle(387, 110, 61, 14));
jLabel20.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel20.setForeground(Color.blue);
jLabel20.setText("出 版 社");
jLabel20.setBounds(new Rectangle(387, 52, 61, 14));
jLabel21.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jLabel21.setForeground(Color.blue);
jLabel21.setText("期刊分类");
jLabel21.setBounds(new Rectangle(387, 22, 61, 14));
jTpRightBottomPanel2.setLayout(null);
jTeaRightTop.getTableHeader().setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jTeaRightTop.getTableHeader().setForeground(Color.blue);
jTeaRightTop.setGridColor(Color.cyan);
jTeaRightTop.setRowHeight(20);
jTeaRightTop.addMouseListener(new
MagazineInfoSystemPanel_jTeaRightTop_mouseAdapter(this));
jPanelRightTopjPanel.setBorder(BorderFactory.createEtchedBorder());
jPanelRightTopjPanel.setBounds(new Rectangle(1, 0, 607, 26));
jPanelRightTopjPanel.setLayout(null);
jScrollPane1.setBorder(null);
jlbM.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
jlbM.setForeground(Color.magenta);
jlbM.setHorizontalAlignment(SwingConstants.CENTER);
jlbM.setHorizontalTextPosition(SwingConstants.CENTER);
jlbM.setText("期刊信息列表");
jlbM.setBounds(new Rectangle(7, 6, 598, 20));
btnReset.setBounds(new Rectangle(290, 189, 123, 30));
btnReset.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnReset.setForeground(Color.blue);
btnReset.setText("数据重置");
btnReset.addActionListener(new
MagazineInfoSystemPanel_btnReset_actionAdapter(this));
btnQueRen.setBounds(new Rectangle(72, 188, 123, 30));
btnQueRen.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnQueRen.setForeground(Color.blue);
btnQueRen.setText("确认添加");
btnQueRen.addActionListener(new
MagazineInfoSystemPanel_btnQueRen_actionAdapter(this));
btnAddInfo.setBounds(new Rectangle(527, 188, 123, 30));
btnAddInfo.setEnabled(false);
btnAddInfo.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnAddInfo.setForeground(Color.blue);
btnAddInfo.setText("添加备注信息");
btnAddInfo.addActionListener(new
MagazineInfoSystemPanel_btnAddInfo_actionAdapter(this));
btnQueRen2.setBounds(new Rectangle(27, 187, 123, 30));
btnQueRen2.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnQueRen2.setForeground(Color.blue);
btnQueRen2.setText("确认添加");
btnQueRen2.addActionListener(new
MagazineInfoSystemPanel_btnQueRen2_actionAdapter(this));
btnReset2.setBounds(new Rectangle(284, 188, 123, 30));
btnReset2.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnReset2.setForeground(Color.blue);
btnReset2.setText("数据重置");
btnReset2.addActionListener(new
MagazineInfoSystemPanel_btnReset2_actionAdapter(this));
btnAddInfo2.setBounds(new Rectangle(531, 184, 123, 30));
btnAddInfo2.setEnabled(true);
btnAddInfo2.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
btnAddInfo2.setForeground(Color.blue);
btnAddInfo2.setText("添加备注信息");
btnAddInfo2.addActionListener(new
MagazineInfoSystemPanel_btnAddInfo2_actionAdapter(this));
magaizeLogOutPanel1.setVisible(false);
jScright.addHierarchyBoundsListener(new
MagazineInfoSystemPanel_jScright_hierarchyBoundsAdapter(this));
jScright.addComponentListener(new
MagazineInfoSystemPanel_jScright_componentAdapter(this));
jPanRight.addHierarchyBoundsListener(new
MagazineInfoSystemPanel_jPanRight_hierarchyBoundsAdapter(this));
this.add(jPanelSystemTop);
jPanelSystemTop.add(jBttsbmrk);
jPanelSystemTop.add(jBttszxgl);
this.add(jSpSystemPanel);
this.add(magaizeLogOutPanel1);
jSpSystemPanel.add(jScleft, JSplitPane.LEFT);
jSpSystemPanel.add(jScright, JSplitPane.RIGHT);
jScright.getViewport().add(jPanRight);
jPanRight.add(jPaneRightBottom);
jPanRight.add(jPanelRightTop);
jPanelRightTop.add(jScrollPane1);
jPanelRightTop.add(jPanelRightTopjPanel);
jPanelRightTopjPanel.add(jlbM);
jScrollPane1.getViewport().add(jTeaRightTop);
jPaneRightBottom.add(jTpRightBottom);
jScleft.getViewport().add(jTreeQikan);
jTpRightBottomjPanel4.add(jLabel6);
jTpRightBottomjPanel4.add(jLabel2);
jTpRightBottomjPanel4.add(jLabel7);
jTpRightBottomjPanel4.add(jLabel4);
jTpRightBottomjPanel4.add(jLabel8);
jTpRightBottomjPanel4.add(jtxBookAuthor);
jTpRightBottomjPanel4.add(jtxBookNum1);
jTpRightBottomjPanel4.add(jtxBookName1);
jTpRightBottomjPanel4.add(jtxBookLanguage);
jTpRightBottomjPanel4.add(jtxBookBorrowMoneyNum1);
jTpRightBottomjPanel4.add(btnAddInfo);
jTpRightBottomjPanel4.add(btnReset);
jTpRightBottomjPanel4.add(btnQueRen);
jTpRightBottomjPanel4.add(jtxBookPurchaseMoney);
jTpRightBottomjPanel4.add(jLabel5);
jTpRightBottomjPanel4.add(jtxBookType1);
jTpRightBottomjPanel4.add(jtxBookConcern1);
jTpRightBottomjPanel4.add(jLabel10);
jTpRightBottomjPanel4.add(jLabel9);
jTpRightBottomjPanel4.add(jtxBookStation);
jTpRightBottomjPanel4.add(jLabel3);
jTpRightBottomjPanel4.add(jLabel1);
jTpRightBottomjPanel4.add(jtxBookBeginHandlers1);
jTpRightBottomPanel2.add(jtxBookBorrowMoneyNum2);
jTpRightBottomPanel2.add(jLabel18);
jTpRightBottomPanel2.add(jtxBookName2);
jTpRightBottomPanel2.add(jtxBookNum2);
jTpRightBottomPanel2.add(jLabel16);
jTpRightBottomPanel2.add(jtxBookAuthor2);
jTpRightBottomPanel2.add(jLabel12);
jTpRightBottomPanel2.add(jLabel13);
jTpRightBottomPanel2.add(jtxBookLanguage2);
jTpRightBottomPanel2.add(btnAddInfo2);
jTpRightBottomPanel2.add(btnReset2);
jTpRightBottomPanel2.add(jLabel17);
jTpRightBottomPanel2.add(btnQueRen2);
jTpRightBottomPanel2.add(jtxBookType2);
jTpRightBottomPanel2.add(jLabel21);
jTpRightBottomPanel2.add(jLabel20);
jTpRightBottomPanel2.add(jLabel14);
jTpRightBottomPanel2.add(jtxBookBeginHandlers2);
jTpRightBottomPanel2.add(jtxBookStation2);
jTpRightBottomPanel2.add(jtxBookPurchaseMoney2);
jTpRightBottomPanel2.add(jtxBookConcern2);
jTpRightBottomPanel2.add(jLabel15);
jTpRightBottomPanel2.add(jLabel19);
jTpRightBottom.add(jTpRightBottomjPanel4, "新期刊入库信息录入业务 ");
jTpRightBottom.add(jTpRightBottomPanel2, "期刊信息的增加、修改业务 ");
}
public void loginTree()
{
ResultSet re = null;
DefaultMutableTreeNode magazinetypeFather[];
DefaultMutableTreeNode magazinetypeChilkl[];
int size = 0;
int j = 0;
int i = 0;
//连接数据库
// if (db.getconn()) {
//获得结果集
re = db.searchMagazinTree();
try
{
while (re.next()) {
size++;
}
magazinetypeFather = new DefaultMutableTreeNode[size];
magazinetypeChilkl = new DefaultMutableTreeNode[size];
boolean a = re.first();
String TypeFather = "";
String TypeChild = "";
for (i = 0, j = 0; a; i++) {
String TypeFather1 = re.getString(2).trim();
String TypeChild1 = re.getString(3).trim();
if(!TypeFather.trim().equals(TypeFather1))
{ TypeFather = TypeFather1;
magazinetypeFather[j] = new DefaultMutableTreeNode(TypeFather);
qikan.add(magazinetypeFather[j]);
j++;
}
magazinetypeChilkl[i] = new DefaultMutableTreeNode(TypeChild1);
magazinetypeFather[j-1].add( magazinetypeChilkl[i]);
a=re.next();
}
jTreeQikan.updateUI();
}
catch (SQLException ex) {
System.out.println(ex.toString());
}
db.myClose(1);
}
public void this_ancestorResized(HierarchyEvent e) {
magaizeLogOutPanel1.setSize((this.getWidth())-5,(this.getHeight()-30));
jSpSystemPanel.setSize( (this.getWidth())-5,(this.getHeight()-30));
jSpSystemPanel.setDividerLocation(0.21);
}
public void jScright_ancestorResized(HierarchyEvent e) {
jPanRight.setSize((jScright.getWidth()-1),(jScright.getHeight()-1));
}
public void jPanRight_ancestorResized(HierarchyEvent e) {
jPanelRightTopjPanel.setSize((jPanelRightTop.getWidth()),25);
jPanelRightTop.setBounds(jPaneRightBottom.getX()+1,(jPaneRightBottom.getY()+jPaneRightBottom.getHeight()-1),(jPanRight.getWidth())-5,(jPanRight.getHeight()*3/7-1));
jScrollPane1.setBounds(1,25,(jPanelRightTop.getWidth())-1,(jPanelRightTop.getHeight())-25);
jlbM.setBounds(5,2,jPanelRightTopjPanel.getWidth()-10,20);
jPaneRightBottom.setSize((jPanRight.getWidth())-5,(jPanRight.getHeight())*4/7-2);
}
public void jScright_componentResized(ComponentEvent e) {
jPanRight.setSize((jScright.getWidth()-1),(jScright.getHeight()-1));
}
public void jPaneRightBottom_componentResized(ComponentEvent e) {
jTpRightBottom.setSize(jPaneRightBottom.getWidth()-1,jPaneRightBottom.getHeight()-1);
}
public void jTreBooks_mouseClicked(MouseEvent e) {
display();
}
public void tableDisp(String sql)
{
String[][] data;
ResultSet rs;
try
{
rs = db.booksInfosearch(sql);
int count=0;
while(rs.next())
count++;
rs.first();
data = new String[count][title.length];
for(int i=0;i<count;i++)
{
for(int j=0;j<title.length;j++)
{
String s = rs.getString(j+2);
if(s==null)
s="null";
data[i][j] = s.trim();
}
rs.next();
}
DefaultTableModel model = new DefaultTableModel(data,title);
jTeaRightTop.setModel(model);
jTeaRightTop.updateUI();
}
catch(SQLException sex)
{
System.out.println(sex.toString());
// sex.printStackTrace();
}
db.myClose(1);
}
public void display()
{
DefaultMutableTreeNode clickNode = (DefaultMutableTreeNode) jTreeQikan.getLastSelectedPathComponent();
String sql="";
String sql2= "";
String bti="";
//数据库表没有见
if (clickNode != null ) {
//查询条件许转换
if(clickNode.toString().trim().equals("所有期刊"))
{
bti="%";
}
else
{
sql = "select TypeID from typechaxun where magazinTypeName='"+clickNode.toString().trim() + "'";
sql2 = "select TypeID1 from typechaxun where typeName='"+clickNode.toString().trim() + "'";
db.search(sql);
try {
if (db.rs.next())
bti = db.rs.getString(1).trim();
else
{
db.myClose(1);
db.search(sql2);
if (db.rs.next())
bti = db.rs.getString(1).trim();
}
} catch (SQLException ex) {
System.out.println(ex.toString());
}
db.myClose(1);
}
sql = "select * from magazineInfo where typenumbers like'"+bti.trim()+"'+'%'";
jlbM.setText(clickNode.toString().trim()+"类 期刊信息列表");
jtxBookType1.setText(clickNode.toString().trim());
// jtxBookType2.setText(clickNode.toString().trim());
fenlei=clickNode.toString().trim();
tableDisp(sql);
}
}
public void jtxBookNum2_mouseClicked(MouseEvent e) {
inputBooksNum(jtxBookNum2);
}
public void inputBooksNum(JTextField a)
{
String bianhao="";
try {
bianhao= JOptionPane.showInputDialog(null,"请输入需要增加期刊的编号 例如 ","W00020070800000001").trim();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -